Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759147AbZAIX7N (ORCPT ); Fri, 9 Jan 2009 18:59:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754338AbZAIX6w (ORCPT ); Fri, 9 Jan 2009 18:58:52 -0500 Received: from styx.suse.cz ([82.119.242.94]:46002 "EHLO mail.suse.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754290AbZAIX6v (ORCPT ); Fri, 9 Jan 2009 18:58:51 -0500 Date: Sat, 10 Jan 2009 00:58:50 +0100 (CET) From: Jiri Kosina To: Alexey Zaytsev cc: LKML , Trivial Kernel Patches Subject: Re: [PATCH 4/5] Fix dubious bitwise 'and' usage spotted by sparse. In-Reply-To: <20090109234821.11800.74193.stgit@zaytsev.su> Message-ID: References: <20090109234113.11800.55672.stgit@zaytsev.su> <20090109234821.11800.74193.stgit@zaytsev.su> User-Agent: Alpine 1.10 (LNX 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1263 Lines: 35 On Sat, 10 Jan 2009, Alexey Zaytsev wrote: > It doesn't change the semantics, but it looks like > the logical 'and' was meant to be used here. > > Signed-off-by: Alexey Zaytsev > --- > drivers/net/wireless/ath9k/rc.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c > index cca2fc5..e8eb20d 100644 > --- a/drivers/net/wireless/ath9k/rc.c > +++ b/drivers/net/wireless/ath9k/rc.c > @@ -609,7 +609,7 @@ ath_rc_get_nextvalid_txrate(const struct ath_rate_table *rate_table, > > static int ath_rc_valid_phyrate(u32 phy, u32 capflag, int ignore_cw) > { > - if (WLAN_RC_PHY_HT(phy) & !(capflag & WLAN_RC_HT_FLAG)) > + if (WLAN_RC_PHY_HT(phy) && !(capflag & WLAN_RC_HT_FLAG)) > return FALSE; > if (WLAN_RC_PHY_DS(phy) && !(capflag & WLAN_RC_DS_FLAG)) > return FALSE; This one needs a small fixup, as the buggy code got moved around to ath_rc_valid_phyrate(). -- Jiri Kosina SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/