Prev: [patch 1/2] x86, apic: Allow to use sertain functions without APIC built-in support
Next: [tip:perf/core] perf tools: Introduce xzalloc() for detecting out of memory conditions
From: Richard Kennedy on 17 Mar 2010 07:10 I'm getting this error from checkpatch which is a false positive AFAICT. I don't see any other way to code this macro so maybe this rule shouldn't apply?. ERROR: space prohibited before open square bracket '[' #24: FILE: drivers/staging/wlan-ng/p80211wext.c:1685: +#define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT] regards Richard -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Andy Whitcroft on 17 Mar 2010 08:00 On Wed, Mar 17, 2010 at 11:00:29AM +0000, Richard Kennedy wrote: > I'm getting this error from checkpatch which is a false positive AFAICT. > I don't see any other way to code this macro so maybe this rule > shouldn't apply?. > > ERROR: space prohibited before open square bracket '[' > #24: FILE: drivers/staging/wlan-ng/p80211wext.c:1685: > +#define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT] Yes that is definatly false, feed free to ignore it. I'll have a look at fixing it. -apw -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Joe Perches on 17 Mar 2010 11:30 On Wed, 2010-03-17 at 11:00 +0000, Richard Kennedy wrote: > I'm getting this error from checkpatch which is a false positive AFAICT. > I don't see any other way to code this macro so maybe this rule > shouldn't apply?. > > ERROR: space prohibited before open square bracket '[' > #24: FILE: drivers/staging/wlan-ng/p80211wext.c:1685: > +#define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT] While true that this is a false positive, hiding array indexing brackets in a macro doesn't seem a good idea. Maybe it'd be better to move the brackets to the use? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Richard Kennedy on 17 Mar 2010 11:50
On Wed, 2010-03-17 at 08:25 -0700, Joe Perches wrote: > On Wed, 2010-03-17 at 11:00 +0000, Richard Kennedy wrote: > > I'm getting this error from checkpatch which is a false positive AFAICT. > > I don't see any other way to code this macro so maybe this rule > > shouldn't apply?. > > > > ERROR: space prohibited before open square bracket '[' > > #24: FILE: drivers/staging/wlan-ng/p80211wext.c:1685: > > +#define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT] > > While true that this is a false positive, hiding array indexing > brackets in a macro doesn't seem a good idea. > > Maybe it'd be better to move the brackets to the use? > > err maybe ;) I copied it from driver/net/wireless/ipw2x00/ipw2200.c It just reduces typing when initialising the array :- #define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT] static iw_handler p80211wext_handlers[] = { IW_IOCTL(SIOCSIWCOMMIT) = (iw_handler) p80211wext_siwcommit, ... Oh, having quickly looked at wireless.h, I see there is already a macro IW_IOCTL_IDX so I guess I should have used that! would something like this be better? static iw_handler p80211wext_handlers[] = { [IW_IOCTL_IDX(SIOCSIWCOMMIT)] = (iw_handler) p80211wext_siwcommit, ... regards Richard -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |