Patchwork [08/21] NTB: declare unused variables

login
register
mail settings
Submitter Jon Mason
Date Jan. 19, 2013, 9:02 a.m.
Message ID <1358586155-23322-9-git-send-email-jon.mason@intel.com>
Download mbox | patch
Permalink /patch/213799/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Jon Mason - Jan. 19, 2013, 9:02 a.m.
Tag pci_device_id in ntb_pci_probe as unused function parameters.  This
corrects issues found by 'EXTRA_CFLAGS=-W'.

Signed-off-by: Jon Mason <jon.mason@intel.com>
---
 drivers/ntb/ntb_hw.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Greg KH - Jan. 20, 2013, 11:42 p.m.
On Sat, Jan 19, 2013 at 02:02:22AM -0700, Jon Mason wrote:
> Tag pci_device_id in ntb_pci_probe as unused function parameters.  This
> corrects issues found by 'EXTRA_CFLAGS=-W'.

Why would you build the kernel with that option?  This isn't needed, so
I'm not going to apply it.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jon Mason - Jan. 21, 2013, 5:50 p.m.
On Sun, Jan 20, 2013 at 03:42:28PM -0800, Greg KH wrote:
> On Sat, Jan 19, 2013 at 02:02:22AM -0700, Jon Mason wrote:
> > Tag pci_device_id in ntb_pci_probe as unused function parameters.  This
> > corrects issues found by 'EXTRA_CFLAGS=-W'.
> 
> Why would you build the kernel with that option?  This isn't needed, so

Per Documentation/SubmitChecklist:

22: Newly-added code has been compiled with `gcc -W' (use "make
    EXTRA_CFLAGS=-W").  This will generate lots of noise, but is good for
    finding bugs like "warning: comparison between signed and unsigned".


I was attempting to comply with that suggestion.  If this is
unnecessary, then I can toss these, but I don't really see them
hurting anything.

Same goes for the other 2 patches found via 'EXTRA_CFLAGS=-W'.

Thanks,
Jon

> I'm not going to apply it.
> 
> thanks,
> 
> greg k-h
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg KH - Jan. 21, 2013, 6:25 p.m.
On Mon, Jan 21, 2013 at 10:50:55AM -0700, Jon Mason wrote:
> On Sun, Jan 20, 2013 at 03:42:28PM -0800, Greg KH wrote:
> > On Sat, Jan 19, 2013 at 02:02:22AM -0700, Jon Mason wrote:
> > > Tag pci_device_id in ntb_pci_probe as unused function parameters.  This
> > > corrects issues found by 'EXTRA_CFLAGS=-W'.
> > 
> > Why would you build the kernel with that option?  This isn't needed, so
> 
> Per Documentation/SubmitChecklist:
> 
> 22: Newly-added code has been compiled with `gcc -W' (use "make
>     EXTRA_CFLAGS=-W").  This will generate lots of noise, but is good for
>     finding bugs like "warning: comparison between signed and unsigned".
> 
> 
> I was attempting to comply with that suggestion.  If this is
> unnecessary, then I can toss these, but I don't really see them
> hurting anything.

It's messy and unneeded, so I'd not recommend using it.  As the
checklist says, it generates a lot of noise, and is good for finding
real bugs, this isn't a "real" bug at all.

> Same goes for the other 2 patches found via 'EXTRA_CFLAGS=-W'.

Understood, I've not applied them either :)

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/ntb/ntb_hw.c b/drivers/ntb/ntb_hw.c
index 867ccaa..2357c2d 100644
--- a/drivers/ntb/ntb_hw.c
+++ b/drivers/ntb/ntb_hw.c
@@ -1007,7 +1007,8 @@  static void ntb_free_callbacks(struct ntb_device *ndev)
 	kfree(ndev->db_cb);
 }
 
-static int ntb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+static int ntb_pci_probe(struct pci_dev *pdev,
+			 __attribute__((unused)) const struct pci_device_id *id)
 {
 	struct ntb_device *ndev;
 	int rc, i;