From: Christian Lamparter <chunkeey@googlemail.com>
To: Fengguang Wu <fengguang.wu@intel.com>
Cc: kernel-janitors@vger.kernel.org,
"John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org
Subject: Re: [wireless-testing:master 68/100] drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison of distinct pointer types lacks a cast
Date: Sat, 11 Aug 2012 11:49:47 +0200 [thread overview]
Message-ID: <201208111149.47874.chunkeey@googlemail.com> (raw)
In-Reply-To: <20120811084404.GA7755@localhost>
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
next prev parent reply other threads:[~2012-08-11 9:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-11 8:44 [wireless-testing:master 68/100] drivers/net/wireless/p54/eeprom.c:291:15: warning: comparison of distinct pointer types lacks a cast Fengguang Wu
2012-08-11 9:49 ` Christian Lamparter [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201208111149.47874.chunkeey@googlemail.com \
--to=chunkeey@googlemail.com \
--cc=fengguang.wu@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).