From: Christian Lamparter <chunkeey@googlemail.com>
To: linux-wireless@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, fengguang.wu@intel.com,
linville@tuxdriver.com
Subject: [PATCH] p54: fix powerpc gcc warnings
Date: Sat, 11 Aug 2012 13:09:20 +0200 [thread overview]
Message-ID: <E1T09jx-0003TA-6G@debian64.localnet> (raw)
In-Reply-To: <201208111257.26417.chunkeey@googlemail.com>
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
prev parent reply other threads:[~2012-08-11 11:20 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
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 ` Christian Lamparter [this message]
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=E1T09jx-0003TA-6G@debian64.localnet \
--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).