Message ID | 1456850284-8336-1-git-send-email-wsa@the-dreams.de (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Geert Uytterhoeven |
Headers | show |
On Tue, Mar 01, 2016 at 05:37:58PM +0100, Wolfram Sang wrote: > From: Wolfram Sang <wsa+renesas@sang-engineering.com> > > This change will also make Coverity happy by avoiding a theoretical NULL > pointer dereference; yet another reason is to use the above helper function > to tighten the code and make it more readable. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
On Tue, Mar 1, 2016 at 5:37 PM, Wolfram Sang <wsa@the-dreams.de> wrote: > From: Wolfram Sang <wsa+renesas@sang-engineering.com> > > This change will also make Coverity happy by avoiding a theoretical NULL > pointer dereference; yet another reason is to use the above helper function > to tighten the code and make it more readable. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
From: Wolfram Sang <wsa@the-dreams.de> Date: Tue, 1 Mar 2016 17:37:58 +0100 > From: Wolfram Sang <wsa+renesas@sang-engineering.com> > > This change will also make Coverity happy by avoiding a theoretical NULL > pointer dereference; yet another reason is to use the above helper function > to tighten the code and make it more readable. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Applied.
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index c936682aae68df..b8613a611a6278 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -1706,7 +1706,6 @@ static int ravb_set_gti(struct net_device *ndev) static int ravb_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; - const struct of_device_id *match; struct ravb_private *priv; enum ravb_chip_id chip_id; struct net_device *ndev; @@ -1738,8 +1737,7 @@ static int ravb_probe(struct platform_device *pdev) ndev->base_addr = res->start; ndev->dma = -1; - match = of_match_device(of_match_ptr(ravb_match_table), &pdev->dev); - chip_id = (enum ravb_chip_id)match->data; + chip_id = (enum ravb_chip_id)of_device_get_match_data(&pdev->dev); if (chip_id == RCAR_GEN3) irq = platform_get_irq_byname(pdev, "ch22");