* Re: [wireless-testing:master 68/100] drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison o [not found] <20120811084404.GA7755@localhost> @ 2012-08-11 9:49 ` Christian Lamparter 2012-08-11 9:59 ` Fengguang Wu 0 siblings, 1 reply; 7+ messages in thread From: Christian Lamparter @ 2012-08-11 9:49 UTC (permalink / raw) To: Fengguang Wu; +Cc: kernel-janitors, John W. Linville, linux-wireless On Saturday 11 August 2012 10:44:04 Fengguang Wu wrote: > Hi Christian, > > FYI, there are new compile warnings show up in Thanks for telling me. Are these "normal" gcc's warnings for PPC? Because the usual C=2 CF=-D__CHECK_ENDIAN__ doesn't show anything (on a x86 no cross-compile). > tree: git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git master > head: 0eba6e668abe4e0760d9d5e20921cc6000a77a85 > commit: 9bc63816be9bf504414d350e605a4b30f857907d [68/100] p54: parse output power table > config: powerpc-allmodconfig (attached as .config) > > All error/warnings: > > drivers/net/wireless/p54/eeprom.c: In function 'p54_get_maxpower': > drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > drivers/net/wireless/p54/eeprom.c:292:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > drivers/net/wireless/p54/eeprom.c:293:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > drivers/net/wireless/p54/eeprom.c:294:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] interesting, rawpower is declared as u16. whereas le16_to_cpu returns a __u16. (is that all, or is there something I don't see?) Anyway, since you are currently the only person I know, would you mind telling me if either (or both?) of those patches has/have an effect? patch 1: make rawpower __u16 --- diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c index d4d8610..f503a3b 100644 --- a/drivers/net/wireless/p54/eeprom.c +++ b/drivers/net/wireless/p54/eeprom.c @@ -283,7 +283,7 @@ static int p54_get_maxpower(struct p54_common *priv, void *data) case PDR_SYNTH_FRONTEND_LONGBOW: { struct pda_channel_output_limit_longbow *pda = data; int j; - u16 rawpower = 0; + __u16 rawpower = 0; pda = data; for (j = 0; j < ARRAY_SIZE(pda->point); j++) { struct pda_channel_output_limit_point_longbow *point --- patch2: use max_t --- diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c index d4d8610..0a9a3e7 100644 --- a/drivers/net/wireless/p54/eeprom.c +++ b/drivers/net/wireless/p54/eeprom.c @@ -288,10 +288,10 @@ static int p54_get_maxpower(struct p54_common *priv, void *data) for (j = 0; j < ARRAY_SIZE(pda->point); j++) { struct pda_channel_output_limit_point_longbow *point &pda->point[j]; - rawpower = max(rawpower, le16_to_cpu(point->val_qpsk)); - rawpower = max(rawpower, le16_to_cpu(point->val_bpsk)); - rawpower = max(rawpower, le16_to_cpu(point->val_16qam)); - rawpower = max(rawpower, le16_to_cpu(point->val_64qam)); + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_qpsk)); + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_bpsk)); + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_16qam)); + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_64qam)); } /* longbow seems to use 1/16 dBm units */ return rawpower / 16; --- Regards, Christian ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [wireless-testing:master 68/100] drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison o 2012-08-11 9:49 ` [wireless-testing:master 68/100] drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison o Christian Lamparter @ 2012-08-11 9:59 ` Fengguang Wu 2012-08-11 10:29 ` Christian Lamparter 0 siblings, 1 reply; 7+ messages in thread From: Fengguang Wu @ 2012-08-11 9:59 UTC (permalink / raw) To: Christian Lamparter; +Cc: kernel-janitors, John W. Linville, linux-wireless On Sat, Aug 11, 2012 at 11:49:47AM +0200, Christian Lamparter wrote: > On Saturday 11 August 2012 10:44:04 Fengguang Wu wrote: > > Hi Christian, > > > > FYI, there are new compile warnings show up in > > Thanks for telling me. Are these "normal" gcc's warnings > for PPC? Because the usual C=2 CF=-D__CHECK_ENDIAN__ > doesn't show anything (on a x86 no cross-compile). Yes, I don't use any special flags. > > tree: git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git master > > head: 0eba6e668abe4e0760d9d5e20921cc6000a77a85 > > commit: 9bc63816be9bf504414d350e605a4b30f857907d [68/100] p54: parse output power table > > config: powerpc-allmodconfig (attached as .config) > > > > All error/warnings: > > > > drivers/net/wireless/p54/eeprom.c: In function 'p54_get_maxpower': > > drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > > drivers/net/wireless/p54/eeprom.c:292:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > > drivers/net/wireless/p54/eeprom.c:293:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > > drivers/net/wireless/p54/eeprom.c:294:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > > interesting, rawpower is declared as u16. > whereas le16_to_cpu returns a __u16. > (is that all, or is there something I don't see?) > > Anyway, since you are currently the only person > I know, would you mind telling me if either (or > both?) of those patches has/have an effect? > > patch 1: make rawpower __u16 Thanks for the quick fix! It works (build log follows). Thanks, Fengguang --- wfg@bee ~/tip/obj-compiletest% make allmodconfig /usr/bin/make -j40 -C source O=/home/wfg/tip/obj-compiletest ARCH=powerpc CROSS_COMPILE=/usr/local/gcc-4.6.3-nolibc/powerpc64-linux/bin/powerpc64-linux- -j32 allmodconfig make: Entering directory `/c/wfg/tip' HOSTCC scripts/basic/fixdep GEN /cc/wfg/tip-compiletest/Makefile HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.hash.c SHIPPED scripts/kconfig/zconf.lex.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf scripts/kconfig/conf --allmodconfig Kconfig warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) selects FSL_LBC which has unmet direct dependencies (FSL_SOC) # # configuration written to .config # make: Leaving directory `/c/wfg/tip' wfg@bee ~/tip/obj-compiletest% make drivers/net/wireless/p54/ /usr/bin/make -j40 -C source O=/home/wfg/tip/obj-compiletest ARCH=powerpc CROSS_COMPILE=/usr/local/gcc-4.6.3-nolibc/powerpc64-linux/bin/powerpc64-linux- -j32 drivers/net/wireless/p54/ make: Entering directory `/c/wfg/tip' GEN /cc/wfg/tip-compiletest/Makefile scripts/kconfig/conf --silentoldconfig Kconfig warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) selects FSL_LBC which has unmet direct dependencies (FSL_SOC) warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) selects FSL_LBC which has unmet direct dependencies (FSL_SOC) GEN /cc/wfg/tip-compiletest/Makefile WRAP arch/powerpc/include/generated/asm/rwsem.h CHK include/linux/version.h UPD include/linux/version.h HOSTCC scripts/dtc/checks.o HOSTCC scripts/pnmtologo HOSTCC scripts/conmakehash HOSTCC scripts/kallsyms HOSTCC scripts/bin2c HOSTCC scripts/dtc/data.o HOSTCC scripts/dtc/dtc-lexer.lex.o HOSTCC scripts/dtc/dtc-parser.tab.o HOSTCC scripts/dtc/dtc.o HOSTCC scripts/dtc/flattree.o HOSTCC scripts/dtc/fstree.o HOSTCC scripts/dtc/livetree.o HOSTCC scripts/genksyms/genksyms.o HOSTCC scripts/dtc/srcpos.o CC scripts/mod/empty.o HOSTCC scripts/mod/mk_elfconfig SHIPPED scripts/genksyms/lex.lex.c HOSTCC scripts/dtc/treesource.o HOSTCC scripts/selinux/genheaders/genheaders HOSTCC scripts/dtc/util.o SHIPPED scripts/genksyms/parse.tab.h SHIPPED scripts/genksyms/keywords.hash.c HOSTCC scripts/selinux/mdp/mdp SHIPPED scripts/genksyms/parse.tab.c HOSTCC scripts/genksyms/lex.lex.o HOSTCC scripts/genksyms/parse.tab.o MKELF scripts/mod/elfconfig.h HOSTCC scripts/mod/file2alias.o HOSTCC scripts/mod/modpost.o HOSTCC scripts/mod/sumversion.o HOSTLD scripts/dtc/dtc HOSTLD scripts/genksyms/genksyms HOSTLD scripts/mod/modpost Using /c/wfg/tip as source for kernel CHK include/generated/utsrelease.h UPD include/generated/utsrelease.h CC kernel/bounds.s GEN include/generated/bounds.h CC arch/powerpc/kernel/asm-offsets.s GEN include/generated/asm-offsets.h CALL /c/wfg/tip/scripts/checksyscalls.sh LD drivers/net/wireless/p54/built-in.o CC [M] drivers/net/wireless/p54/eeprom.o CC [M] drivers/net/wireless/p54/fwio.o CC [M] drivers/net/wireless/p54/txrx.o CC [M] drivers/net/wireless/p54/main.o CC [M] drivers/net/wireless/p54/led.o CC [M] drivers/net/wireless/p54/p54usb.o CC [M] drivers/net/wireless/p54/p54pci.o CC [M] drivers/net/wireless/p54/p54spi.o LD [M] drivers/net/wireless/p54/p54common.o make: Leaving directory `/c/wfg/tip' wfg@bee ~/tip/obj-compiletest% .. wfg@bee ~/tip% q pop Removing patch patches/mutt-wfg-t420-1000-8534-5234451332105763812 Restoring drivers/net/wireless/p54/eeprom.c No patches applied wfg@bee ~/tip% cd - ~/tip/obj-compiletest wfg@bee ~/tip/obj-compiletest% make drivers/net/wireless/p54/ /usr/bin/make -j40 -C source O=/home/wfg/tip/obj-compiletest ARCH=powerpc CROSS_COMPILE=/usr/local/gcc-4.6.3-nolibc/powerpc64-linux/bin/powerpc64-linux- -j32 drivers/net/wireless/p54/ make: Entering directory `/c/wfg/tip' GEN /cc/wfg/tip-compiletest/Makefile CHK include/linux/version.h Using /c/wfg/tip as source for kernel CHK include/generated/utsrelease.h UPD include/generated/utsrelease.h CALL /c/wfg/tip/scripts/checksyscalls.sh CC [M] drivers/net/wireless/p54/eeprom.o /c/wfg/tip/drivers/net/wireless/p54/eeprom.c: In function 'p54_get_maxpower': /c/wfg/tip/drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] /c/wfg/tip/drivers/net/wireless/p54/eeprom.c:292:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] /c/wfg/tip/drivers/net/wireless/p54/eeprom.c:293:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] /c/wfg/tip/drivers/net/wireless/p54/eeprom.c:294:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] LD [M] drivers/net/wireless/p54/p54common.o make: Leaving directory `/c/wfg/tip' wfg@bee ~/tip/obj-compiletest% ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [wireless-testing:master 68/100] drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison o 2012-08-11 9:59 ` Fengguang Wu @ 2012-08-11 10:29 ` Christian Lamparter 2012-08-11 10:41 ` Fengguang Wu 0 siblings, 1 reply; 7+ messages in thread From: Christian Lamparter @ 2012-08-11 10:29 UTC (permalink / raw) To: Fengguang Wu; +Cc: kernel-janitors, John W. Linville, linux-wireless On Saturday 11 August 2012 11:59:51 Fengguang Wu wrote: > On Sat, Aug 11, 2012 at 11:49:47AM +0200, Christian Lamparter wrote: > > On Saturday 11 August 2012 10:44:04 Fengguang Wu wrote: > > > Hi Christian, > > > > > > FYI, there are new compile warnings show up in > > > > Thanks for telling me. Are these "normal" gcc's warnings > > for PPC? Because the usual C=2 CF=-D__CHECK_ENDIAN__ > > doesn't show anything (on a x86 no cross-compile). > > Yes, I don't use any special flags. > > > > tree: git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git master > > > head: 0eba6e668abe4e0760d9d5e20921cc6000a77a85 > > > commit: 9bc63816be9bf504414d350e605a4b30f857907d [68/100] p54: parse output power table > > > config: powerpc-allmodconfig (attached as .config) > > > > > > All error/warnings: > > > > > > drivers/net/wireless/p54/eeprom.c: In function 'p54_get_maxpower': > > > drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > > > drivers/net/wireless/p54/eeprom.c:292:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > > > drivers/net/wireless/p54/eeprom.c:293:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > > > drivers/net/wireless/p54/eeprom.c:294:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > > > > interesting, rawpower is declared as u16. > > whereas le16_to_cpu returns a __u16. > > (is that all, or is there something I don't see?) > > > > Anyway, since you are currently the only person > > I know, would you mind telling me if either (or > > both?) of those patches has/have an effect? > > > > patch 1: make rawpower __u16 > > Thanks for the quick fix! It works (build log follows). > > wfg@bee ~/tip/obj-compiletest% make drivers/net/wireless/p54/ > /usr/bin/make -j40 -C source O=/home/wfg/tip/obj-compiletest ARCH=powerpc > CROSS_COMPILE=/usr/local/gcc-4.6.3-nolibc/powerpc64-linux/bin/powerpc64-linux- -j32 > drivers/net/wireless/p54/ OT: why is there a "-j40" (after make) and "-j32" (after CROSS_COMPILE) in the command line? Isn't one -jXY enough anymore? > CC [M] drivers/net/wireless/p54/eeprom.o [...] > LD [M] drivers/net/wireless/p54/p54common.o > make: Leaving directory `/c/wfg/tip' > wfg@bee ~/tip/obj-compiletest% .. > wfg@bee ~/tip% q pop > Removing patch patches/mutt-wfg-t420-1000-8534-5234451332105763812 > Restoring drivers/net/wireless/p54/eeprom.c > Is this patch 1, or patch 2... or both? Regards, Chr ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [wireless-testing:master 68/100] drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison o 2012-08-11 10:29 ` Christian Lamparter @ 2012-08-11 10:41 ` Fengguang Wu 2012-08-11 10:57 ` Christian Lamparter 0 siblings, 1 reply; 7+ messages in thread From: Fengguang Wu @ 2012-08-11 10:41 UTC (permalink / raw) To: Christian Lamparter; +Cc: kernel-janitors, John W. Linville, linux-wireless On Sat, Aug 11, 2012 at 12:29:34PM +0200, Christian Lamparter wrote: > On Saturday 11 August 2012 11:59:51 Fengguang Wu wrote: > > On Sat, Aug 11, 2012 at 11:49:47AM +0200, Christian Lamparter wrote: > > > On Saturday 11 August 2012 10:44:04 Fengguang Wu wrote: > > > > Hi Christian, > > > > > > > > FYI, there are new compile warnings show up in > > > > > > Thanks for telling me. Are these "normal" gcc's warnings > > > for PPC? Because the usual C=2 CF=-D__CHECK_ENDIAN__ > > > doesn't show anything (on a x86 no cross-compile). > > > > Yes, I don't use any special flags. > > > > > > tree: git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git master > > > > head: 0eba6e668abe4e0760d9d5e20921cc6000a77a85 > > > > commit: 9bc63816be9bf504414d350e605a4b30f857907d [68/100] p54: parse output power table > > > > config: powerpc-allmodconfig (attached as .config) > > > > > > > > All error/warnings: > > > > > > > > drivers/net/wireless/p54/eeprom.c: In function 'p54_get_maxpower': > > > > drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > > > > drivers/net/wireless/p54/eeprom.c:292:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > > > > drivers/net/wireless/p54/eeprom.c:293:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > > > > drivers/net/wireless/p54/eeprom.c:294:15: warning: comparison of distinct pointer types lacks a cast [enabled by default] > > > > > > interesting, rawpower is declared as u16. > > > whereas le16_to_cpu returns a __u16. > > > (is that all, or is there something I don't see?) > > > > > > Anyway, since you are currently the only person > > > I know, would you mind telling me if either (or > > > both?) of those patches has/have an effect? > > > > > > patch 1: make rawpower __u16 > > > > Thanks for the quick fix! It works (build log follows). > > > > wfg@bee ~/tip/obj-compiletest% make drivers/net/wireless/p54/ > > /usr/bin/make -j40 -C source O=/home/wfg/tip/obj-compiletest ARCH=powerpc > > CROSS_COMPILE=/usr/local/gcc-4.6.3-nolibc/powerpc64-linux/bin/powerpc64-linux- -j32 > > drivers/net/wireless/p54/ > OT: why is there a "-j40" (after make) and "-j32" (after CROSS_COMPILE) > in the command line? Isn't one -jXY enough anymore? Err, one is from shell alias, another is added by the script.. It's a bit awkward, but there are situations that one cannot cover the other, and in the cases they both take effect, the last one will take effect. > > CC [M] drivers/net/wireless/p54/eeprom.o > [...] > > LD [M] drivers/net/wireless/p54/p54common.o > > make: Leaving directory `/c/wfg/tip' > > wfg@bee ~/tip/obj-compiletest% .. > > wfg@bee ~/tip% q pop > > Removing patch patches/mutt-wfg-t420-1000-8534-5234451332105763812 > > Restoring drivers/net/wireless/p54/eeprom.c > > > Is this patch 1, or patch 2... or both? It's the only applied patch (and is from you). Thanks, Fengguang ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [wireless-testing:master 68/100] drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison o 2012-08-11 10:41 ` Fengguang Wu @ 2012-08-11 10:57 ` Christian Lamparter 2012-08-11 11:05 ` Fengguang Wu 2012-08-11 11:09 ` [PATCH] p54: fix powerpc gcc warnings Christian Lamparter 0 siblings, 2 replies; 7+ messages in thread From: Christian Lamparter @ 2012-08-11 10:57 UTC (permalink / raw) To: Fengguang Wu; +Cc: kernel-janitors, John W. Linville, linux-wireless On Saturday 11 August 2012 12:41:33 Fengguang Wu wrote: > On Sat, Aug 11, 2012 at 12:29:34PM +0200, Christian Lamparter wrote: > > On Saturday 11 August 2012 11:59:51 Fengguang Wu wrote: > > > On Sat, Aug 11, 2012 at 11:49:47AM +0200, Christian Lamparter wrote: > > > CC [M] drivers/net/wireless/p54/eeprom.o > > [...] > > > LD [M] drivers/net/wireless/p54/p54common.o > > > make: Leaving directory `/c/wfg/tip' > > > wfg@bee ~/tip/obj-compiletest% .. > > > wfg@bee ~/tip% q pop > > > Removing patch patches/mutt-wfg-t420-1000-8534-5234451332105763812 > > > Restoring drivers/net/wireless/p54/eeprom.c > > > > > Is this patch 1, or patch 2... or both? > > It's the only applied patch (and is from you). Ok, either I'm confusing, or I confused myself. In the original response I sent you two patches. take a look: There's "patch 1: make rawpower __u16" and the other one is: "patch2: use max_t" what I want to know: Which patch fixed the warning as it looks like from your response that you have applied both on the same time on that try: > Removing patch patches/mutt-wfg-t420-1000-8534-5234451332105763812 I have the suspicion that "patch1" actually doesn't do anything in this regard, but you never know. Regards, Chr BTW: I've attached just one patch (patch2 - this time) So, you don't need to extract it from the other mail and can just apply this one. Thanks! --- diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c index d4d8610..0a9a3e7 100644 --- a/drivers/net/wireless/p54/eeprom.c +++ b/drivers/net/wireless/p54/eeprom.c @@ -288,10 +288,10 @@ static int p54_get_maxpower(struct p54_common *priv, void *data) for (j = 0; j < ARRAY_SIZE(pda->point); j++) { struct pda_channel_output_limit_point_longbow *point &pda->point[j]; - rawpower = max(rawpower, le16_to_cpu(point->val_qpsk)); - rawpower = max(rawpower, le16_to_cpu(point->val_bpsk)); - rawpower = max(rawpower, le16_to_cpu(point->val_16qam)); - rawpower = max(rawpower, le16_to_cpu(point->val_64qam)); + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_qpsk)); + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_bpsk)); + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_16qam)); + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_64qam)); } /* longbow seems to use 1/16 dBm units */ return rawpower / 16; ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [wireless-testing:master 68/100] drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison o 2012-08-11 10:57 ` Christian Lamparter @ 2012-08-11 11:05 ` Fengguang Wu 2012-08-11 11:09 ` [PATCH] p54: fix powerpc gcc warnings Christian Lamparter 1 sibling, 0 replies; 7+ messages in thread From: Fengguang Wu @ 2012-08-11 11:05 UTC (permalink / raw) To: Christian Lamparter; +Cc: kernel-janitors, John W. Linville, linux-wireless On Sat, Aug 11, 2012 at 12:57:26PM +0200, Christian Lamparter wrote: > On Saturday 11 August 2012 12:41:33 Fengguang Wu wrote: > > On Sat, Aug 11, 2012 at 12:29:34PM +0200, Christian Lamparter wrote: > > > On Saturday 11 August 2012 11:59:51 Fengguang Wu wrote: > > > > On Sat, Aug 11, 2012 at 11:49:47AM +0200, Christian Lamparter wrote: > > > > CC [M] drivers/net/wireless/p54/eeprom.o > > > [...] > > > > LD [M] drivers/net/wireless/p54/p54common.o > > > > make: Leaving directory `/c/wfg/tip' > > > > wfg@bee ~/tip/obj-compiletest% .. > > > > wfg@bee ~/tip% q pop > > > > Removing patch patches/mutt-wfg-t420-1000-8534-5234451332105763812 > > > > Restoring drivers/net/wireless/p54/eeprom.c > > > > > > > Is this patch 1, or patch 2... or both? > > > > It's the only applied patch (and is from you). > > Ok, either I'm confusing, or I confused myself. > > In the original response I sent you two patches. > take a look: There's "patch 1: make rawpower __u16" > > and the other one is: > > "patch2: use max_t" > > what I want to know: Which patch fixed the warning as > it looks like from your response that you have applied > both on the same time on that try: > > Removing patch patches/mutt-wfg-t420-1000-8534-5234451332105763812 > > I have the suspicion that "patch1" actually > doesn't do anything in this regard, but you > never know. Ah sorry! I blindly imported the email and thus both patches are applied: wfg@bee ~/tip% q dif --- tip.orig/drivers/net/wireless/p54/eeprom.c 2012-08-11 17:56:16.945732793 +0800 +++ tip/drivers/net/wireless/p54/eeprom.c 2012-08-11 19:00:29.077671218 +0800 @@ -283,15 +283,15 @@ static int p54_get_maxpower(struct p54_c case PDR_SYNTH_FRONTEND_LONGBOW: { struct pda_channel_output_limit_longbow *pda = data; int j; - u16 rawpower = 0; + __u16 rawpower = 0; pda = data; for (j = 0; j < ARRAY_SIZE(pda->point); j++) { struct pda_channel_output_limit_point_longbow *point &pda->point[j]; - rawpower = max(rawpower, le16_to_cpu(point->val_qpsk)); - rawpower = max(rawpower, le16_to_cpu(point->val_bpsk)); - rawpower = max(rawpower, le16_to_cpu(point->val_16qam)); - rawpower = max(rawpower, le16_to_cpu(point->val_64qam)); + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_qpsk)); + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_bpsk)); + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_16qam)); + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_64qam)); } /* longbow seems to use 1/16 dBm units */ return rawpower / 16; > Regards, > Chr > > BTW: I've attached just one patch (patch2 - this time) > So, you don't need to extract it from the other mail > and can just apply this one. Thanks! Tests show that this patch2 alone works. The other patch1 alone won't work. Thanks, Fengguang > --- > diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c > index d4d8610..0a9a3e7 100644 > --- a/drivers/net/wireless/p54/eeprom.c > +++ b/drivers/net/wireless/p54/eeprom.c > @@ -288,10 +288,10 @@ static int p54_get_maxpower(struct p54_common *priv, void *data) > for (j = 0; j < ARRAY_SIZE(pda->point); j++) { > struct pda_channel_output_limit_point_longbow *point > &pda->point[j]; > - rawpower = max(rawpower, le16_to_cpu(point->val_qpsk)); > - rawpower = max(rawpower, le16_to_cpu(point->val_bpsk)); > - rawpower = max(rawpower, le16_to_cpu(point->val_16qam)); > - rawpower = max(rawpower, le16_to_cpu(point->val_64qam)); > + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_qpsk)); > + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_bpsk)); > + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_16qam)); > + rawpower = max_t(u16, rawpower, le16_to_cpu(point->val_64qam)); > } > /* longbow seems to use 1/16 dBm units */ > return rawpower / 16; ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] p54: fix powerpc gcc warnings 2012-08-11 10:57 ` Christian Lamparter 2012-08-11 11:05 ` Fengguang Wu @ 2012-08-11 11:09 ` Christian Lamparter 1 sibling, 0 replies; 7+ messages in thread From: Christian Lamparter @ 2012-08-11 11:09 UTC (permalink / raw) To: linux-wireless; +Cc: kernel-janitors, fengguang.wu, linville My commit "p54: parse output power table" introduced the following compiler warnings for powerpc-allmodconfig eeprom.c: In function 'p54_get_maxpower': eeprom.c:291 warning: comparison of distinct pointer types lacks a cast eeporm.c:292 warning: comparison of distinct pointer types lacks a cast eeprom.c:293 warning: comparison of distinct pointer types lacks a cast eeprom.c:294 warning: comparison of distinct pointer types lacks a cast This patch fixes those by using max_t(u16 which forces a type cast. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Tested-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> --- drivers/net/wireless/p54/eeprom.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c index d4d8610..1ef1bfe 100644 --- a/drivers/net/wireless/p54/eeprom.c +++ b/drivers/net/wireless/p54/eeprom.c @@ -288,10 +288,14 @@ static int p54_get_maxpower(struct p54_common *priv, void *data) for (j = 0; j < ARRAY_SIZE(pda->point); j++) { struct pda_channel_output_limit_point_longbow *point &pda->point[j]; - rawpower = max(rawpower, le16_to_cpu(point->val_qpsk)); - rawpower = max(rawpower, le16_to_cpu(point->val_bpsk)); - rawpower = max(rawpower, le16_to_cpu(point->val_16qam)); - rawpower = max(rawpower, le16_to_cpu(point->val_64qam)); + rawpower = max_t(u16, + rawpower, le16_to_cpu(point->val_qpsk)); + rawpower = max_t(u16, + rawpower, le16_to_cpu(point->val_bpsk)); + rawpower = max_t(u16, + rawpower, le16_to_cpu(point->val_16qam)); + rawpower = max_t(u16, + rawpower, le16_to_cpu(point->val_64qam)); } /* longbow seems to use 1/16 dBm units */ return rawpower / 16; -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-08-11 11:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20120811084404.GA7755@localhost>
2012-08-11 9:49 ` [wireless-testing:master 68/100] drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison o Christian Lamparter
2012-08-11 9:59 ` Fengguang Wu
2012-08-11 10:29 ` Christian Lamparter
2012-08-11 10:41 ` Fengguang Wu
2012-08-11 10:57 ` Christian Lamparter
2012-08-11 11:05 ` Fengguang Wu
2012-08-11 11:09 ` [PATCH] p54: fix powerpc gcc warnings Christian Lamparter
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).