提交 22c5649e 编写于 作者: C Christian Lamparter 提交者: John W. Linville

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: NFengguang Wu <fengguang.wu@intel.com>
Tested-by: NFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: NChristian Lamparter <chunkeey@googlemail.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 df323818
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册