* [PATCH] orinoco: Fix compile warnings
@ 2008-09-12 21:28 David Kilroy
2008-09-13 3:03 ` Pavel Roskin
0 siblings, 1 reply; 2+ messages in thread
From: David Kilroy @ 2008-09-12 21:28 UTC (permalink / raw)
To: linux-wireless; +Cc: David Kilroy
Use min_t to avoid warnings when the typesafe version is used.
Explicitly cast u64s to unsigned long long when being passed to printk.
Signed-off-by: David Kilroy <kilroyd@googlemail.com>
---
This should fix the following warnings reported by David Miller (though I couldn't reproduce them).
drivers/net/wireless/orinoco.c: In function 'orinoco_ioctl_get_encodeext':
drivers/net/wireless/orinoco.c:4780: warning: comparison of distinct pointer types lacks a cast
drivers/net/wireless/orinoco.c: In function 'orinoco_translate_ext_scan':
drivers/net/wireless/orinoco.c:5691: warning: format '%016llx' expects type 'long long unsigned int', but argument 4 has type 'long unsigned int'
---
drivers/net/wireless/orinoco.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index ec0451c..9a2fcc0 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -4777,14 +4777,14 @@ static int orinoco_ioctl_get_encodeext(struct net_device *dev,
encoding->flags |= IW_ENCODE_DISABLED;
break;
case IW_ENCODE_ALG_WEP:
- ext->key_len = min(le16_to_cpu(priv->keys[idx].len),
- (u16) max_key_len);
+ ext->key_len = min_t(u16, le16_to_cpu(priv->keys[idx].len),
+ max_key_len);
memcpy(ext->key, priv->keys[idx].data, ext->key_len);
encoding->flags |= IW_ENCODE_ENABLED;
break;
case IW_ENCODE_ALG_TKIP:
- ext->key_len = min((u16) sizeof(struct orinoco_tkip_key),
- (u16) max_key_len);
+ ext->key_len = min_t(u16, sizeof(struct orinoco_tkip_key),
+ max_key_len);
memcpy(ext->key, &priv->tkip_key[idx], ext->key_len);
encoding->flags |= IW_ENCODE_ENABLED;
break;
@@ -5686,9 +5686,9 @@ static inline char *orinoco_translate_ext_scan(struct net_device *dev,
/* Timestamp */
iwe.cmd = IWEVCUSTOM;
- iwe.u.data.length = snprintf(custom, MAX_CUSTOM_LEN,
- "tsf=%016llx",
- le64_to_cpu(bss->timestamp));
+ iwe.u.data.length =
+ snprintf(custom, MAX_CUSTOM_LEN, "tsf=%016llx",
+ (unsigned long long) le64_to_cpu(bss->timestamp));
if (iwe.u.data.length)
current_ev = iwe_stream_add_point(info, current_ev, end_buf,
&iwe, custom);
--
1.5.6.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] orinoco: Fix compile warnings
2008-09-12 21:28 [PATCH] orinoco: Fix compile warnings David Kilroy
@ 2008-09-13 3:03 ` Pavel Roskin
0 siblings, 0 replies; 2+ messages in thread
From: Pavel Roskin @ 2008-09-13 3:03 UTC (permalink / raw)
To: David Kilroy; +Cc: linux-wireless
On Fri, 2008-09-12 at 22:28 +0100, David Kilroy wrote:
> Use min_t to avoid warnings when the typesafe version is used.
>
> Explicitly cast u64s to unsigned long long when being passed to printk.
>
> Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Acked-by: Pavel Roskin <proski@gnu.org>
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-13 3:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-12 21:28 [PATCH] orinoco: Fix compile warnings David Kilroy
2008-09-13 3:03 ` Pavel Roskin
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).