提交 dc73c623 编写于 作者: A Al Viro 提交者: David S. Miller

p54common annotations and fixes

* ->exp_id in bootrec_exp_if is __le16; missing conversion in its use
* !(x & y) misspelled as !x & y
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 e0c0056c
...@@ -54,7 +54,7 @@ void p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) ...@@ -54,7 +54,7 @@ void p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
u32 code = le32_to_cpu(bootrec->code); u32 code = le32_to_cpu(bootrec->code);
switch (code) { switch (code) {
case BR_CODE_COMPONENT_ID: case BR_CODE_COMPONENT_ID:
switch (be32_to_cpu(*bootrec->data)) { switch (be32_to_cpu(*(__be32 *)bootrec->data)) {
case FW_FMAC: case FW_FMAC:
printk(KERN_INFO "p54: FreeMAC firmware\n"); printk(KERN_INFO "p54: FreeMAC firmware\n");
break; break;
...@@ -78,14 +78,14 @@ void p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) ...@@ -78,14 +78,14 @@ void p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
fw_version = (unsigned char*)bootrec->data; fw_version = (unsigned char*)bootrec->data;
break; break;
case BR_CODE_DESCR: case BR_CODE_DESCR:
priv->rx_start = le32_to_cpu(bootrec->data[1]); priv->rx_start = le32_to_cpu(((__le32 *)bootrec->data)[1]);
/* FIXME add sanity checking */ /* FIXME add sanity checking */
priv->rx_end = le32_to_cpu(bootrec->data[2]) - 0x3500; priv->rx_end = le32_to_cpu(((__le32 *)bootrec->data)[2]) - 0x3500;
break; break;
case BR_CODE_EXPOSED_IF: case BR_CODE_EXPOSED_IF:
exp_if = (struct bootrec_exp_if *) bootrec->data; exp_if = (struct bootrec_exp_if *) bootrec->data;
for (i = 0; i < (len * sizeof(*exp_if) / 4); i++) for (i = 0; i < (len * sizeof(*exp_if) / 4); i++)
if (exp_if[i].if_id == 0x1a) if (exp_if[i].if_id == cpu_to_le16(0x1a))
priv->fw_var = le16_to_cpu(exp_if[i].variant); priv->fw_var = le16_to_cpu(exp_if[i].variant);
break; break;
case BR_CODE_DEPENDENT_IF: case BR_CODE_DEPENDENT_IF:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册