p54: fix powerpc gcc warnings
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Sat Sep 29 10:59:35 EDT 2012
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=22c5649eef0fc37532e20c14d2656b28ca708a69
Commit: 22c5649eef0fc37532e20c14d2656b28ca708a69
Parent: df32381896f5f0c78a371df2e49ab7c776b1a5ba
Author: Christian Lamparter <chunkeey at googlemail.com>
AuthorDate: Sat Aug 11 13:09:20 2012 +0200
Committer: John W. Linville <linville at tuxdriver.com>
CommitDate: Mon Aug 13 15:28:35 2012 -0400
p54: fix powerpc gcc warnings
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 at intel.com>
Tested-by: Fengguang Wu <fengguang.wu at intel.com>
Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
Signed-off-by: John W. Linville <linville at tuxdriver.com>
---
drivers/net/wireless/p54/eeprom.c | 12 ++++++++----
1 files 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;
More information about the linux-mtd-cvs
mailing list