Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751773AbaABP52 (ORCPT ); Thu, 2 Jan 2014 10:57:28 -0500 Received: from mail-ob0-f176.google.com ([209.85.214.176]:55228 "EHLO mail-ob0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbaABP51 (ORCPT ); Thu, 2 Jan 2014 10:57:27 -0500 MIME-Version: 1.0 In-Reply-To: <1388680129-13661-1-git-send-email-Julia.Lawall@lip6.fr> References: <1388680129-13661-1-git-send-email-Julia.Lawall@lip6.fr> Date: Thu, 2 Jan 2014 07:57:26 -0800 Message-ID: Subject: Re: [PATCH] net: tulip: delete useless tests on netdev_priv From: Grant Grundler To: Julia Lawall Cc: Grant Grundler , kernel-janitors@vger.kernel.org, "open list:TULIP NETWORK DRI..." , open list Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1674 Lines: 62 On Thu, Jan 2, 2014 at 8:28 AM, Julia Lawall wrote: > From: Julia Lawall > > Netdev_priv performs an addition, not a pointer dereference, so it seems > quit unlikely that its result would ever be NULL. LGTM. > > A semantic patch that makes this change is as follows: > (http://coccinelle.lip6.fr/) > > // > @@ > statement S; > @@ > > - if (!netdev_priv(...)) S > // > > Signed-off-by: Julia Lawall Acked-by: Grant Grundler cheers, grant > > --- > drivers/net/ethernet/dec/tulip/uli526x.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/net/ethernet/dec/tulip/uli526x.c b/drivers/net/ethernet/dec/tulip/uli526x.c > index a5397b1..aa4ee38 100644 > --- a/drivers/net/ethernet/dec/tulip/uli526x.c > +++ b/drivers/net/ethernet/dec/tulip/uli526x.c > @@ -1192,9 +1192,6 @@ static int uli526x_suspend(struct pci_dev *pdev, pm_message_t state) > > ULI526X_DBUG(0, "uli526x_suspend", 0); > > - if (!netdev_priv(dev)) > - return 0; > - > pci_save_state(pdev); > > if (!netif_running(dev)) > @@ -1228,9 +1225,6 @@ static int uli526x_resume(struct pci_dev *pdev) > > ULI526X_DBUG(0, "uli526x_resume", 0); > > - if (!netdev_priv(dev)) > - return 0; > - > pci_restore_state(pdev); > > if (!netif_running(dev)) > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/