Skip to content

Commit

Permalink
libertas: remove two libertas sparse warning
Browse files Browse the repository at this point in the history
Johannes Berg detected this two sparse warnings:

drivers/net/wireless/libertas/cmd.c:609:16: warning: cast to restricted __le16
drivers/net/wireless/libertas/cmd.c:611:16: warning: cast to restricted __le16

... but cmd.minlevel is "s8", so we can access it directly and hope
for the sign-extension-code in the compiler to convert that to the
"s16" type.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Holger Schurig authored and John W. Linville committed Oct 29, 2008
1 parent 10d0bd5 commit 87bf24f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,9 @@ int lbs_get_tx_power(struct lbs_private *priv, s16 *curlevel, s16 *minlevel,
if (ret == 0) {
*curlevel = le16_to_cpu(cmd.curlevel);
if (minlevel)
*minlevel = le16_to_cpu(cmd.minlevel);
*minlevel = cmd.minlevel;
if (maxlevel)
*maxlevel = le16_to_cpu(cmd.maxlevel);
*maxlevel = cmd.maxlevel;
}

lbs_deb_leave(LBS_DEB_CMD);
Expand Down

0 comments on commit 87bf24f

Please sign in to comment.