* libertas and endianness
@ 2007-10-07 10:15 Geert Uytterhoeven
2007-10-08 9:06 ` Holger Schurig
2007-10-08 9:07 ` [PATCH] libertas: fix u8 constant Holger Schurig
0 siblings, 2 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2007-10-07 10:15 UTC (permalink / raw)
To: Jeff Garzik, netdev, linux-wireless
Cc: Andrew Morton, Linux Kernel Development
Somehow (haven't found out why it suddenly got compiled, no .config
changes) this showed up in the list of warnings in 2.6.23-rc9 compared
to -rc8 on one of my m68k builds:
| drivers/net/wireless/libertas/cmd.c:189: warning: large integer implicitly truncated to unsigned type
| drivers/net/wireless/libertas/cmd.c:195: warning: large integer implicitly truncated to unsigned type
The offending lines are:
| wep->keytype[i] = cpu_to_le16(cmd_type_wep_40_bit);
| wep->keytype[i] = cpu_to_le16(cmd_type_wep_104_bit);
I.e. it tries to store 0x0100 resp. 0x0200 into keytype[i], which is is u8.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: libertas and endianness
2007-10-07 10:15 libertas and endianness Geert Uytterhoeven
@ 2007-10-08 9:06 ` Holger Schurig
2007-10-08 12:55 ` Dan Williams
2007-10-08 9:07 ` [PATCH] libertas: fix u8 constant Holger Schurig
1 sibling, 1 reply; 5+ messages in thread
From: Holger Schurig @ 2007-10-08 9:06 UTC (permalink / raw)
To: linux-wireless
> I.e. it tries to store 0x0100 resp. 0x0200 into keytype[i],
> which is is u8.
>
> Gr{oetje,eeting}s,
Dan Williams partially fixed this on 2nd August. Seems that
libertas patches needs ages to trickle upwards.
The patch is buried in the libertas-2.6 tree, in the
branch "libertas". See here:
http://git.infradead.org/?p=libertas-2.6.git;a=commitdiff;h=1bf710a1f1bd816897be3b0441d3c916ea1b9ab9
However, in my next mail I'm attaching a cosmetic change for
this. There's no need to define a constant for an u8 as 0x0001
and 0x0002 ...
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] libertas: fix u8 constant
2007-10-07 10:15 libertas and endianness Geert Uytterhoeven
2007-10-08 9:06 ` Holger Schurig
@ 2007-10-08 9:07 ` Holger Schurig
2007-10-08 12:55 ` Dan Williams
1 sibling, 1 reply; 5+ messages in thread
From: Holger Schurig @ 2007-10-08 9:07 UTC (permalink / raw)
To: linux-wireless; +Cc: Dan Williams
Don't write constants that are (per documentation and struct) u8
as 0x0001, use 0x01 instead. Also remove an useless cast.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Index: libertas-2.6/drivers/net/wireless/libertas/host.h
===================================================================
--- libertas-2.6.orig/drivers/net/wireless/libertas/host.h 2007-10-08 11:51:46.000000000 +0200
+++ libertas-2.6/drivers/net/wireless/libertas/host.h 2007-10-08 11:52:10.000000000 +0200
@@ -138,8 +138,8 @@
#define CMD_ACT_REMOVE 0x0004
#define CMD_ACT_USE_DEFAULT 0x0008
-#define CMD_TYPE_WEP_40_BIT 0x0001
-#define CMD_TYPE_WEP_104_BIT 0x0002
+#define CMD_TYPE_WEP_40_BIT 0x01
+#define CMD_TYPE_WEP_104_BIT 0x02
#define CMD_NUM_OF_WEP_KEYS 4
Index: libertas-2.6/drivers/net/wireless/libertas/cmd.c
===================================================================
--- libertas-2.6.orig/drivers/net/wireless/libertas/cmd.c 2007-10-08 11:52:13.000000000 +0200
+++ libertas-2.6/drivers/net/wireless/libertas/cmd.c 2007-10-08 11:52:36.000000000 +0200
@@ -181,13 +181,13 @@ static int wlan_cmd_802_11_set_wep(wlan_
switch (pkey->len) {
case KEY_LEN_WEP_40:
- wep->keytype[i] = (u8)CMD_TYPE_WEP_40_BIT;
+ wep->keytype[i] = CMD_TYPE_WEP_40_BIT;
memmove(&wep->keymaterial[i], pkey->key,
pkey->len);
lbs_deb_cmd("SET_WEP: add key %d (40 bit)\n", i);
break;
case KEY_LEN_WEP_104:
- wep->keytype[i] = (u8)CMD_TYPE_WEP_104_BIT;
+ wep->keytype[i] = CMD_TYPE_WEP_104_BIT;
memmove(&wep->keymaterial[i], pkey->key,
pkey->len);
lbs_deb_cmd("SET_WEP: add key %d (104 bit)\n", i);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] libertas: fix u8 constant
2007-10-08 9:07 ` [PATCH] libertas: fix u8 constant Holger Schurig
@ 2007-10-08 12:55 ` Dan Williams
0 siblings, 0 replies; 5+ messages in thread
From: Dan Williams @ 2007-10-08 12:55 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless
On Mon, 2007-10-08 at 11:07 +0200, Holger Schurig wrote:
> Don't write constants that are (per documentation and struct) u8
> as 0x0001, use 0x01 instead. Also remove an useless cast.
>
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-By: Dan Williams <dcbw@redhat.com>
>
> Index: libertas-2.6/drivers/net/wireless/libertas/host.h
> ===================================================================
> --- libertas-2.6.orig/drivers/net/wireless/libertas/host.h 2007-10-08 11:51:46.000000000 +0200
> +++ libertas-2.6/drivers/net/wireless/libertas/host.h 2007-10-08 11:52:10.000000000 +0200
> @@ -138,8 +138,8 @@
> #define CMD_ACT_REMOVE 0x0004
> #define CMD_ACT_USE_DEFAULT 0x0008
>
> -#define CMD_TYPE_WEP_40_BIT 0x0001
> -#define CMD_TYPE_WEP_104_BIT 0x0002
> +#define CMD_TYPE_WEP_40_BIT 0x01
> +#define CMD_TYPE_WEP_104_BIT 0x02
>
> #define CMD_NUM_OF_WEP_KEYS 4
>
> Index: libertas-2.6/drivers/net/wireless/libertas/cmd.c
> ===================================================================
> --- libertas-2.6.orig/drivers/net/wireless/libertas/cmd.c 2007-10-08 11:52:13.000000000 +0200
> +++ libertas-2.6/drivers/net/wireless/libertas/cmd.c 2007-10-08 11:52:36.000000000 +0200
> @@ -181,13 +181,13 @@ static int wlan_cmd_802_11_set_wep(wlan_
>
> switch (pkey->len) {
> case KEY_LEN_WEP_40:
> - wep->keytype[i] = (u8)CMD_TYPE_WEP_40_BIT;
> + wep->keytype[i] = CMD_TYPE_WEP_40_BIT;
> memmove(&wep->keymaterial[i], pkey->key,
> pkey->len);
> lbs_deb_cmd("SET_WEP: add key %d (40 bit)\n", i);
> break;
> case KEY_LEN_WEP_104:
> - wep->keytype[i] = (u8)CMD_TYPE_WEP_104_BIT;
> + wep->keytype[i] = CMD_TYPE_WEP_104_BIT;
> memmove(&wep->keymaterial[i], pkey->key,
> pkey->len);
> lbs_deb_cmd("SET_WEP: add key %d (104 bit)\n", i);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: libertas and endianness
2007-10-08 9:06 ` Holger Schurig
@ 2007-10-08 12:55 ` Dan Williams
0 siblings, 0 replies; 5+ messages in thread
From: Dan Williams @ 2007-10-08 12:55 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless
On Mon, 2007-10-08 at 11:06 +0200, Holger Schurig wrote:
> > I.e. it tries to store 0x0100 resp. 0x0200 into keytype[i],
> > which is is u8.
> >
> > Gr{oetje,eeting}s,
>
> Dan Williams partially fixed this on 2nd August. Seems that
> libertas patches needs ages to trickle upwards.
The patches are queued for 2.6.24 and are already in net-2.6.24.
They've been in net-2.6.24 for quite a while. Anything that's in
libertas-2.6 is already queued for 2.6.24 when the merge window opens.
http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.24.git;a=commit;h=1118759a15da6e97e8101a7f025b2947f190505f
The order is:
libertas-2.6 -> wireless-2.6 -> net-2.6.x -> linus
So these will go upstream. Where these patches _could_ go is to stable,
for fixing up what's already out there in 2.6.22 and 2.6.23.
Dan
> The patch is buried in the libertas-2.6 tree, in the
> branch "libertas". See here:
>
> http://git.infradead.org/?p=libertas-2.6.git;a=commitdiff;h=1bf710a1f1bd816897be3b0441d3c916ea1b9ab9
>
>
>
> However, in my next mail I'm attaching a cosmetic change for
> this. There's no need to define a constant for an u8 as 0x0001
> and 0x0002 ...
> -
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-10-08 12:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-07 10:15 libertas and endianness Geert Uytterhoeven
2007-10-08 9:06 ` Holger Schurig
2007-10-08 12:55 ` Dan Williams
2007-10-08 9:07 ` [PATCH] libertas: fix u8 constant Holger Schurig
2007-10-08 12:55 ` Dan Williams
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).