linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: mac80211: optimize ieee80211_rx_status struct layout
@ 2012-07-13  8:52 Dan Carpenter
  2012-07-13  8:54 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-07-13  8:52 UTC (permalink / raw)
  To: johannes.berg; +Cc: linux-wireless

Hello Johannes Berg,

The patch 30f422925c39: "mac80211: optimize ieee80211_rx_status 
struct layout" from Jul 5, 2012, leads to the following warning:
drivers/net/wireless/b43/xmit.c:773 b43_rx()
	 error: status.rate_idx is never equal to -1 (wrong type 0 - 255).

drivers/net/wireless/b43/xmit.c
   768          if (phystat0 & B43_RX_PHYST0_OFDM)
   769                  status.rate_idx = b43_plcp_get_bitrate_idx_ofdm(plcp,
   770                                                  phytype == B43_PHYTYPE_A);
   771          else
   772                  status.rate_idx = b43_plcp_get_bitrate_idx_cck(plcp);
   773          if (unlikely(status.rate_idx == -1)) {
   774                  /* PLCP seems to be corrupted.
   775                   * Drop the frame, if we are not interested in corrupted frames. */
   776                  if (!(dev->wl->filter_flags & FIF_PLCPFAIL))
   777                          goto drop;
   778          }

b43_plcp_get_bitrate_idx_ofdm() and b43_plcp_get_bitrate_idx_cck()
return -1 on error.  The "rate_idx" variable used to be an int but now
it's a u8.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mac80211: optimize ieee80211_rx_status struct layout
  2012-07-13  8:52 mac80211: optimize ieee80211_rx_status struct layout Dan Carpenter
@ 2012-07-13  8:54 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2012-07-13  8:54 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-wireless

Yay... Thanks Dan.


> drivers/net/wireless/b43/xmit.c
>    768          if (phystat0 & B43_RX_PHYST0_OFDM)
>    769                  status.rate_idx = b43_plcp_get_bitrate_idx_ofdm(plcp,
>    770                                                  phytype == B43_PHYTYPE_A);
>    771          else
>    772                  status.rate_idx = b43_plcp_get_bitrate_idx_cck(plcp);
>    773          if (unlikely(status.rate_idx == -1)) {
>    774                  /* PLCP seems to be corrupted.
>    775                   * Drop the frame, if we are not interested in corrupted frames. */
>    776                  if (!(dev->wl->filter_flags & FIF_PLCPFAIL))
>    777                          goto drop;

Looks like it should have a temporary variable, I'll post a fix.

johannes


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-13  8:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-13  8:52 mac80211: optimize ieee80211_rx_status struct layout Dan Carpenter
2012-07-13  8:54 ` Johannes Berg

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).