* [PATCH 8/9] isdn: Remove unused variable causing a compile build warning [not found] <1351980150-24145-1-git-send-email-lee.jones@linaro.org> @ 2012-11-03 22:02 ` Lee Jones 2012-11-03 22:40 ` Paul Bolle 2012-11-03 22:02 ` [PATCH 9/9] Avoid 'statement with no effect' compiler warnings Lee Jones 1 sibling, 1 reply; 17+ messages in thread From: Lee Jones @ 2012-11-03 22:02 UTC (permalink / raw) To: linux-kernel; +Cc: Lee Jones, Karsten Keil, netdev This patch fixes: drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’: drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable] Cc: Karsten Keil <isdn@linux-pingi.de> Cc: netdev@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> --- drivers/isdn/i4l/isdn_common.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index 8c610fa..fb90d40 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c @@ -1275,7 +1275,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) int ret; int i; char __user *p; - char *s; union iocpar { char name[10]; char bname[22]; -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning 2012-11-03 22:02 ` [PATCH 8/9] isdn: Remove unused variable causing a compile build warning Lee Jones @ 2012-11-03 22:40 ` Paul Bolle 2012-11-03 22:48 ` Lee Jones 2012-11-04 10:28 ` [PATCH v2 8/9] isdn: Remove unused variable causing a compile build warning Lee Jones 0 siblings, 2 replies; 17+ messages in thread From: Paul Bolle @ 2012-11-03 22:40 UTC (permalink / raw) To: Lee Jones; +Cc: linux-kernel, Karsten Keil, netdev On Sat, 2012-11-03 at 23:02 +0100, Lee Jones wrote: > This patch fixes: > drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’: > drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable] Did you have CONFIG_NETDEVICES not set in this build? Paul Bolle ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning 2012-11-03 22:40 ` Paul Bolle @ 2012-11-03 22:48 ` Lee Jones 2012-11-04 10:14 ` Paul Bolle 2012-11-04 10:28 ` [PATCH v2 8/9] isdn: Remove unused variable causing a compile build warning Lee Jones 1 sibling, 1 reply; 17+ messages in thread From: Lee Jones @ 2012-11-03 22:48 UTC (permalink / raw) To: Paul Bolle; +Cc: linux-kernel, Karsten Keil, netdev On Sat, 03 Nov 2012, Paul Bolle wrote: > On Sat, 2012-11-03 at 23:02 +0100, Lee Jones wrote: > > This patch fixes: > > drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’: > > drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable] > > Did you have CONFIG_NETDEVICES not set in this build? Ah yes, I see it. The function went down further than I thought it did. So the real fix is to ensure 's' is defined inside of some ifdef CONFIG_NETDEVICES guards. I'll fix up and resend. Will likely be tomorrow now, as it's fast approaching midnight here. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning 2012-11-03 22:48 ` Lee Jones @ 2012-11-04 10:14 ` Paul Bolle 2012-11-04 10:53 ` Lee Jones 0 siblings, 1 reply; 17+ messages in thread From: Paul Bolle @ 2012-11-04 10:14 UTC (permalink / raw) To: Lee Jones; +Cc: linux-kernel, Karsten Keil, netdev On Sat, 2012-11-03 at 23:48 +0100, Lee Jones wrote: > On Sat, 03 Nov 2012, Paul Bolle wrote: > > On Sat, 2012-11-03 at 23:02 +0100, Lee Jones wrote: > > > This patch fixes: > > > drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’: > > > drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable] > > > > Did you have CONFIG_NETDEVICES not set in this build? > > Ah yes, I see it. The function went down further than I thought > it did. So the real fix is to ensure 's' is defined inside of > some ifdef CONFIG_NETDEVICES guards. What puzzles me is that we only find these "#ifdef CONFIG_NETDEVICES" guards in this file and not in isdn_net.c, were all the ioctl commands guarded that way seem to be calling into. On first glance that doesn't make much sense. (Actually the idea of having ISDN without NETDEVICES is a bit puzzling too. But there are too many parts of the isdn subsystem that I'm unfamiliar with to say whether that can make sense.) Paul Bolle ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning 2012-11-04 10:14 ` Paul Bolle @ 2012-11-04 10:53 ` Lee Jones 2012-11-04 17:30 ` David Miller 0 siblings, 1 reply; 17+ messages in thread From: Lee Jones @ 2012-11-04 10:53 UTC (permalink / raw) To: Paul Bolle; +Cc: linux-kernel, Karsten Keil, netdev On Sun, 04 Nov 2012, Paul Bolle wrote: > On Sat, 2012-11-03 at 23:48 +0100, Lee Jones wrote: > > On Sat, 03 Nov 2012, Paul Bolle wrote: > > > On Sat, 2012-11-03 at 23:02 +0100, Lee Jones wrote: > > > > This patch fixes: > > > > drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’: > > > > drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable] > > > > > > Did you have CONFIG_NETDEVICES not set in this build? > > > > Ah yes, I see it. The function went down further than I thought > > it did. So the real fix is to ensure 's' is defined inside of > > some ifdef CONFIG_NETDEVICES guards. > > What puzzles me is that we only find these "#ifdef CONFIG_NETDEVICES" > guards in this file and not in isdn_net.c, were all the ioctl commands > guarded that way seem to be calling into. On first glance that doesn't > make much sense. > > (Actually the idea of having ISDN without NETDEVICES is a bit puzzling > too. But there are too many parts of the isdn subsystem that I'm > unfamiliar with to say whether that can make sense.) I'm in the same position as you Paul. I just noticed the warning so fixed it following the current way of doing things. Any, more substantial changes requiring greater knowledge of the subsystem would have to be done by someone else. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning 2012-11-04 10:53 ` Lee Jones @ 2012-11-04 17:30 ` David Miller 2012-11-05 8:44 ` Lee Jones 2012-11-05 10:31 ` [PATCH 8/9] isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES Lee Jones 0 siblings, 2 replies; 17+ messages in thread From: David Miller @ 2012-11-04 17:30 UTC (permalink / raw) To: lee.jones; +Cc: pebolle, linux-kernel, isdn, netdev From: Lee Jones <lee.jones@linaro.org> Date: Sun, 4 Nov 2012 11:53:32 +0100 > On Sun, 04 Nov 2012, Paul Bolle wrote: > >> On Sat, 2012-11-03 at 23:48 +0100, Lee Jones wrote: >> > On Sat, 03 Nov 2012, Paul Bolle wrote: >> > > On Sat, 2012-11-03 at 23:02 +0100, Lee Jones wrote: >> > > > This patch fixes: >> > > > drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’: >> > > > drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable] >> > > >> > > Did you have CONFIG_NETDEVICES not set in this build? >> > >> > Ah yes, I see it. The function went down further than I thought >> > it did. So the real fix is to ensure 's' is defined inside of >> > some ifdef CONFIG_NETDEVICES guards. >> >> What puzzles me is that we only find these "#ifdef CONFIG_NETDEVICES" >> guards in this file and not in isdn_net.c, were all the ioctl commands >> guarded that way seem to be calling into. On first glance that doesn't >> make much sense. >> >> (Actually the idea of having ISDN without NETDEVICES is a bit puzzling >> too. But there are too many parts of the isdn subsystem that I'm >> unfamiliar with to say whether that can make sense.) > > I'm in the same position as you Paul. I just noticed the warning so > fixed it following the current way of doing things. Any, more > substantial changes requiring greater knowledge of the subsystem > would have to be done by someone else. I think the most appropriate thing to do is make CONFIG_ISDN depend upon CONFIG_NETDEVICES in the Kconfig file. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning 2012-11-04 17:30 ` David Miller @ 2012-11-05 8:44 ` Lee Jones 2012-11-05 9:11 ` Paul Bolle 2012-11-05 16:46 ` David Miller 2012-11-05 10:31 ` [PATCH 8/9] isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES Lee Jones 1 sibling, 2 replies; 17+ messages in thread From: Lee Jones @ 2012-11-05 8:44 UTC (permalink / raw) To: David Miller; +Cc: pebolle, linux-kernel, isdn, netdev On Sun, 04 Nov 2012, David Miller wrote: > From: Lee Jones <lee.jones@linaro.org> > Date: Sun, 4 Nov 2012 11:53:32 +0100 > > > On Sun, 04 Nov 2012, Paul Bolle wrote: > > > >> On Sat, 2012-11-03 at 23:48 +0100, Lee Jones wrote: > >> > On Sat, 03 Nov 2012, Paul Bolle wrote: > >> > > On Sat, 2012-11-03 at 23:02 +0100, Lee Jones wrote: > >> > > > This patch fixes: > >> > > > drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’: > >> > > > drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable] > >> > > > >> > > Did you have CONFIG_NETDEVICES not set in this build? > >> > > >> > Ah yes, I see it. The function went down further than I thought > >> > it did. So the real fix is to ensure 's' is defined inside of > >> > some ifdef CONFIG_NETDEVICES guards. > >> > >> What puzzles me is that we only find these "#ifdef CONFIG_NETDEVICES" > >> guards in this file and not in isdn_net.c, were all the ioctl commands > >> guarded that way seem to be calling into. On first glance that doesn't > >> make much sense. > >> > >> (Actually the idea of having ISDN without NETDEVICES is a bit puzzling > >> too. But there are too many parts of the isdn subsystem that I'm > >> unfamiliar with to say whether that can make sense.) > > > > I'm in the same position as you Paul. I just noticed the warning so > > fixed it following the current way of doing things. Any, more > > substantial changes requiring greater knowledge of the subsystem > > would have to be done by someone else. > > I think the most appropriate thing to do is make CONFIG_ISDN depend > upon CONFIG_NETDEVICES in the Kconfig file. ... and then remove the CONFIG_NETDEVICES guards in isdn_common.c? If that's suitable more suitable I can do that instead? Just need a yay or nay and I'll make it happen. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning 2012-11-05 8:44 ` Lee Jones @ 2012-11-05 9:11 ` Paul Bolle 2012-11-05 9:44 ` Lee Jones 2012-11-05 16:46 ` David Miller 1 sibling, 1 reply; 17+ messages in thread From: Paul Bolle @ 2012-11-05 9:11 UTC (permalink / raw) To: Lee Jones; +Cc: David Miller, linux-kernel, isdn, netdev On Mon, 2012-11-05 at 09:44 +0100, Lee Jones wrote: > On Sun, 04 Nov 2012, David Miller wrote: > > I think the most appropriate thing to do is make CONFIG_ISDN depend > > upon CONFIG_NETDEVICES in the Kconfig file. > > ... and then remove the CONFIG_NETDEVICES guards in isdn_common.c? If ISDN would depend on NETDEVICES, ISDN_I4L would too, since it depends on ISDN. In that case CONFIG_NETDEVICES would always be true when compiling isdn_common.c. That would make these guards pointless. (The dependency of ISDN_PPP on NETDEVICES would then also be pointless.) Paul Bolle ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning 2012-11-05 9:11 ` Paul Bolle @ 2012-11-05 9:44 ` Lee Jones 0 siblings, 0 replies; 17+ messages in thread From: Lee Jones @ 2012-11-05 9:44 UTC (permalink / raw) To: Paul Bolle; +Cc: David Miller, linux-kernel, isdn, netdev On Mon, 05 Nov 2012, Paul Bolle wrote: > On Mon, 2012-11-05 at 09:44 +0100, Lee Jones wrote: > > On Sun, 04 Nov 2012, David Miller wrote: > > > I think the most appropriate thing to do is make CONFIG_ISDN depend > > > upon CONFIG_NETDEVICES in the Kconfig file. > > > > ... and then remove the CONFIG_NETDEVICES guards in isdn_common.c? > > If ISDN would depend on NETDEVICES, ISDN_I4L would too, since it depends > on ISDN. In that case CONFIG_NETDEVICES would always be true when > compiling isdn_common.c. That would make these guards pointless. (The > dependency of ISDN_PPP on NETDEVICES would then also be pointless.) I'll submit a patch based on your comments. Thanks for your time Paul. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning 2012-11-05 8:44 ` Lee Jones 2012-11-05 9:11 ` Paul Bolle @ 2012-11-05 16:46 ` David Miller 1 sibling, 0 replies; 17+ messages in thread From: David Miller @ 2012-11-05 16:46 UTC (permalink / raw) To: lee.jones; +Cc: pebolle, linux-kernel, isdn, netdev From: Lee Jones <lee.jones@linaro.org> Date: Mon, 5 Nov 2012 09:44:19 +0100 > On Sun, 04 Nov 2012, David Miller wrote: > >> From: Lee Jones <lee.jones@linaro.org> >> Date: Sun, 4 Nov 2012 11:53:32 +0100 >> >> > On Sun, 04 Nov 2012, Paul Bolle wrote: >> > >> >> On Sat, 2012-11-03 at 23:48 +0100, Lee Jones wrote: >> >> > On Sat, 03 Nov 2012, Paul Bolle wrote: >> >> > > On Sat, 2012-11-03 at 23:02 +0100, Lee Jones wrote: >> >> > > > This patch fixes: >> >> > > > drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’: >> >> > > > drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable] >> >> > > >> >> > > Did you have CONFIG_NETDEVICES not set in this build? >> >> > >> >> > Ah yes, I see it. The function went down further than I thought >> >> > it did. So the real fix is to ensure 's' is defined inside of >> >> > some ifdef CONFIG_NETDEVICES guards. >> >> >> >> What puzzles me is that we only find these "#ifdef CONFIG_NETDEVICES" >> >> guards in this file and not in isdn_net.c, were all the ioctl commands >> >> guarded that way seem to be calling into. On first glance that doesn't >> >> make much sense. >> >> >> >> (Actually the idea of having ISDN without NETDEVICES is a bit puzzling >> >> too. But there are too many parts of the isdn subsystem that I'm >> >> unfamiliar with to say whether that can make sense.) >> > >> > I'm in the same position as you Paul. I just noticed the warning so >> > fixed it following the current way of doing things. Any, more >> > substantial changes requiring greater knowledge of the subsystem >> > would have to be done by someone else. >> >> I think the most appropriate thing to do is make CONFIG_ISDN depend >> upon CONFIG_NETDEVICES in the Kconfig file. > > ... and then remove the CONFIG_NETDEVICES guards in isdn_common.c? > > If that's suitable more suitable I can do that instead? > > Just need a yay or nay and I'll make it happen. "yay" ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 8/9] isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES 2012-11-04 17:30 ` David Miller 2012-11-05 8:44 ` Lee Jones @ 2012-11-05 10:31 ` Lee Jones 2012-11-06 23:57 ` David Miller 1 sibling, 1 reply; 17+ messages in thread From: Lee Jones @ 2012-11-05 10:31 UTC (permalink / raw) To: David Miller; +Cc: pebolle, linux-kernel, isdn, netdev Does something like look like a better solution? Author: Lee Jones <lee.jones@linaro.org> Date: Sat Nov 3 22:06:02 2012 +0100 isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES It doesn't make much sense to enable ISDN services if you don't intend to connect to a network. Therefore insisting that ISDN depends on NETDEVICES seems logical. We can then remove any guards mentioning NETDEVICES inside all subordinate drivers. This also has the nice side-effect of fixing the warning below when ISDN_I4L && !CONFIG_NETDEVICES at compile time. This patch fixes: drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’: drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable] Cc: Karsten Keil <isdn@linux-pingi.de> Cc: netdev@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> diff --git a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig index a233ed5..86cd75a 100644 --- a/drivers/isdn/Kconfig +++ b/drivers/isdn/Kconfig @@ -4,7 +4,7 @@ menuconfig ISDN bool "ISDN support" - depends on NET + depends on NET && NETDEVICES depends on !S390 && !UML ---help--- ISDN ("Integrated Services Digital Network", called RNIS in France) diff --git a/drivers/isdn/i4l/Kconfig b/drivers/isdn/i4l/Kconfig index 2302fbe..9c6650e 100644 --- a/drivers/isdn/i4l/Kconfig +++ b/drivers/isdn/i4l/Kconfig @@ -6,7 +6,7 @@ if ISDN_I4L config ISDN_PPP bool "Support synchronous PPP" - depends on INET && NETDEVICES + depends on INET select SLHC help Over digital connections such as ISDN, there is no need to diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index 8c610fa..e2a945e 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c @@ -1312,7 +1312,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) } else return -EINVAL; break; -#ifdef CONFIG_NETDEVICES case IIOCNETGPN: /* Get peer phone number of a connected * isdn network interface */ @@ -1322,7 +1321,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) return isdn_net_getpeer(&phone, argp); } else return -EINVAL; -#endif default: return -EINVAL; } @@ -1352,7 +1350,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) case IIOCNETLCR: printk(KERN_INFO "INFO: ISDN_ABC_LCR_SUPPORT not enabled\n"); return -ENODEV; -#ifdef CONFIG_NETDEVICES case IIOCNETAIF: /* Add a network-interface */ if (arg) { @@ -1491,7 +1488,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) return -EFAULT; return isdn_net_force_hangup(name); break; -#endif /* CONFIG_NETDEVICES */ case IIOCSETVER: dev->net_verbose = arg; printk(KERN_INFO "isdn: Verbose-Level is %d\n", dev->net_verbose); ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 8/9] isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES 2012-11-05 10:31 ` [PATCH 8/9] isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES Lee Jones @ 2012-11-06 23:57 ` David Miller 2012-11-07 9:56 ` Lee Jones 0 siblings, 1 reply; 17+ messages in thread From: David Miller @ 2012-11-06 23:57 UTC (permalink / raw) To: lee.jones; +Cc: pebolle, linux-kernel, isdn, netdev From: Lee Jones <lee.jones@linaro.org> Date: Mon, 5 Nov 2012 11:31:26 +0100 > Does something like look like a better solution? > > Author: Lee Jones <lee.jones@linaro.org> > Date: Sat Nov 3 22:06:02 2012 +0100 > > isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES Yes, it looks good, please resubmit it formally. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 8/9] isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES 2012-11-06 23:57 ` David Miller @ 2012-11-07 9:56 ` Lee Jones 0 siblings, 0 replies; 17+ messages in thread From: Lee Jones @ 2012-11-07 9:56 UTC (permalink / raw) To: David Miller; +Cc: pebolle, linux-kernel, isdn, netdev On Tue, 06 Nov 2012, David Miller wrote: > From: Lee Jones <lee.jones@linaro.org> > Date: Mon, 5 Nov 2012 11:31:26 +0100 > > > Does something like look like a better solution? > > > > Author: Lee Jones <lee.jones@linaro.org> > > Date: Sat Nov 3 22:06:02 2012 +0100 > > > > isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES > > Yes, it looks good, please resubmit it formally. Done. Thanks for reviewing. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 8/9] isdn: Remove unused variable causing a compile build warning 2012-11-03 22:40 ` Paul Bolle 2012-11-03 22:48 ` Lee Jones @ 2012-11-04 10:28 ` Lee Jones 1 sibling, 0 replies; 17+ messages in thread From: Lee Jones @ 2012-11-04 10:28 UTC (permalink / raw) To: Paul Bolle; +Cc: linux-kernel, Karsten Keil, netdev Thanks for reviewing Paul. Here's the result: Author: Lee Jones <lee.jones@linaro.org> Date: Sat Nov 3 22:06:02 2012 +0100 isdn: Encapsulate variable 's' in same CONFIG_NETDEVICES guards as code using it In the current case, variable 's' of type 'char *' is defined but then not used if !CONFIG_NETDEVICES, casing the compile-time warning below. In this change we surround the declaration using the same guards as the pre-processed code which makes use of it. This patch fixes: drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’: drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable] Cc: Karsten Keil <isdn@linux-pingi.de> Cc: netdev@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index 8c610fa..2875f31 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c @@ -1275,7 +1275,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) int ret; int i; char __user *p; - char *s; union iocpar { char name[10]; char bname[22]; @@ -1284,6 +1283,9 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) isdn_net_ioctl_cfg cfg; } iocpar; void __user *argp = (void __user *)arg; +#ifdef CONFIG_NETDEVICES + char *s; +#endif #define name iocpar.name #define bname iocpar.bname ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 9/9] Avoid 'statement with no effect' compiler warnings [not found] <1351980150-24145-1-git-send-email-lee.jones@linaro.org> 2012-11-03 22:02 ` [PATCH 8/9] isdn: Remove unused variable causing a compile build warning Lee Jones @ 2012-11-03 22:02 ` Lee Jones 2012-11-04 6:00 ` David Miller 1 sibling, 1 reply; 17+ messages in thread From: Lee Jones @ 2012-11-03 22:02 UTC (permalink / raw) To: linux-kernel; +Cc: Lee Jones, Stephen Hemminger, bridge, netdev Instead of issuing (0) statements when !CONFIG_SYSFS which will cause 'warning: ', we'll use inline statements instead. This will effectively do the same thing, but suppress any unnecessary warnings. Cc: Stephen Hemminger <shemminger@vyatta.com> Cc: bridge@lists.linux-foundation.org Cc: netdev@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> --- net/bridge/br_private.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 9b278c4..af5f584 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h @@ -566,10 +566,10 @@ extern void br_sysfs_delbr(struct net_device *dev); #else -#define br_sysfs_addif(p) (0) -#define br_sysfs_renameif(p) (0) -#define br_sysfs_addbr(dev) (0) -#define br_sysfs_delbr(dev) do { } while(0) +static inline int br_sysfs_addif(struct net_bridge_port *p) { return 0; } +static inline int br_sysfs_renameif(struct net_bridge_port *p) { return 0; } +static inline int br_sysfs_addbr(struct net_device *dev) { return 0; } +static inline void br_sysfs_delbr(struct net_device *dev) { return; } #endif /* CONFIG_SYSFS */ #endif -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 9/9] Avoid 'statement with no effect' compiler warnings 2012-11-03 22:02 ` [PATCH 9/9] Avoid 'statement with no effect' compiler warnings Lee Jones @ 2012-11-04 6:00 ` David Miller 2012-11-04 7:55 ` Lee Jones 0 siblings, 1 reply; 17+ messages in thread From: David Miller @ 2012-11-04 6:00 UTC (permalink / raw) To: lee.jones; +Cc: linux-kernel, shemminger, bridge, netdev From: Lee Jones <lee.jones@linaro.org> Date: Sat, 3 Nov 2012 23:02:30 +0100 > Instead of issuing (0) statements when !CONFIG_SYSFS which will cause > 'warning: ', we'll use inline statements instead. This will effectively > do the same thing, but suppress any unnecessary warnings. > > Cc: Stephen Hemminger <shemminger@vyatta.com> > Cc: bridge@lists.linux-foundation.org > Cc: netdev@vger.kernel.org > Signed-off-by: Lee Jones <lee.jones@linaro.org> Applied, but please use more informative subject lines. You should prefix your subject line after [PATCH ...] with the name of the subsystem you are touching, a ": " then the headline description. So here you would have used "bridge: " and that's what I added when I commited this patch. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 9/9] Avoid 'statement with no effect' compiler warnings 2012-11-04 6:00 ` David Miller @ 2012-11-04 7:55 ` Lee Jones 0 siblings, 0 replies; 17+ messages in thread From: Lee Jones @ 2012-11-04 7:55 UTC (permalink / raw) To: David Miller; +Cc: linux-kernel, shemminger, bridge, netdev On Sun, 04 Nov 2012, David Miller wrote: > From: Lee Jones <lee.jones@linaro.org> > Date: Sat, 3 Nov 2012 23:02:30 +0100 > > > Instead of issuing (0) statements when !CONFIG_SYSFS which will cause > > 'warning: ', we'll use inline statements instead. This will effectively > > do the same thing, but suppress any unnecessary warnings. > > > > Cc: Stephen Hemminger <shemminger@vyatta.com> > > Cc: bridge@lists.linux-foundation.org > > Cc: netdev@vger.kernel.org > > Signed-off-by: Lee Jones <lee.jones@linaro.org> > > Applied, but please use more informative subject lines. > > You should prefix your subject line after [PATCH ...] with > the name of the subsystem you are touching, a ": " then > the headline description. > > So here you would have used "bridge: " and that's what I added when I > commited this patch. Yes, of course I should have done, and usually do. This was an oversight, sorry about that. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2012-11-07 9:56 UTC | newest] Thread overview: 17+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1351980150-24145-1-git-send-email-lee.jones@linaro.org> 2012-11-03 22:02 ` [PATCH 8/9] isdn: Remove unused variable causing a compile build warning Lee Jones 2012-11-03 22:40 ` Paul Bolle 2012-11-03 22:48 ` Lee Jones 2012-11-04 10:14 ` Paul Bolle 2012-11-04 10:53 ` Lee Jones 2012-11-04 17:30 ` David Miller 2012-11-05 8:44 ` Lee Jones 2012-11-05 9:11 ` Paul Bolle 2012-11-05 9:44 ` Lee Jones 2012-11-05 16:46 ` David Miller 2012-11-05 10:31 ` [PATCH 8/9] isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES Lee Jones 2012-11-06 23:57 ` David Miller 2012-11-07 9:56 ` Lee Jones 2012-11-04 10:28 ` [PATCH v2 8/9] isdn: Remove unused variable causing a compile build warning Lee Jones 2012-11-03 22:02 ` [PATCH 9/9] Avoid 'statement with no effect' compiler warnings Lee Jones 2012-11-04 6:00 ` David Miller 2012-11-04 7:55 ` Lee Jones
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).