libertas and endianness
Subsystems (3)
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 -- [email protected]
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
Quoted 4 lines
I.e. it tries to store
0x0100resp.0x0200into 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 ...
Quoted 7 lines · Holger Schurig
Quoted 4 lines
I.e. it tries to store
0x0100resp.0x0200into 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.
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
Quoted 14 lines
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
0x0001and0x0002...
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 libertas: fix u8 constant
In reply to Geert UytterhoevenDon't write constants that are (per documentation and struct) u8 as 0x0001, use 0x01 instead. Also remove an useless cast.
drivers/net/wireless/libertas/host.h +2 -2
@@ -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
drivers/net/wireless/libertas/cmd.c +2 -2
@@ -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);
Re: [PATCH] libertas: fix u8 constant
Quoted 4 lines · Holger Schurig
Don't write constants that are (per documentation and struct) u8 as
0x0001, use0x01instead. Also remove an useless cast.Signed-off-by Holger Schurig <[email protected]>
Quoted 36 lines
Index:
libertas-2.6/drivers/net/wireless/libertas/host.h
===================================================================drivers/net/wireless/libertas/host.h +2
-2@@ -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 4Index:
libertas-2.6/drivers/net/wireless/libertas/cmd.c
===================================================================drivers/net/wireless/libertas/cmd.c +2
-2@@ -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);