lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200420150235.GA3159@ubuntu>
Date:   Mon, 20 Apr 2020 17:02:35 +0200
From:   Oscar Carter <oscar.carter@....com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Oscar Carter <oscar.carter@....com>,
        Forest Bond <forest@...ttletooquiet.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        devel@...verdev.osuosl.org, Malcolm Priestley <tvboxspy@...il.com>,
        "John B . Wyatt IV" <jbwyatt4@...il.com>,
        linux-kernel@...r.kernel.org,
        Colin Ian King <colin.king@...onical.com>
Subject: Re: [PATCH] staging: vt6656: Use fls instead of for loop in
 vnt_update_top_rates

On Mon, Apr 20, 2020 at 03:10:59PM +0300, Dan Carpenter wrote:
> On Sun, Apr 19, 2020 at 12:09:21PM +0200, Oscar Carter wrote:
> > -	for (i = RATE_11M;; i--) {
> > -		if (priv->basic_rates & (u16)(1 << i)) {
> > -			top_cck = i;
> > -			break;
> > -		}
> > -		if (i == RATE_1M)
> > -			break;
> > -	}
> > +	pos = fls(priv->basic_rates & GENMASK(RATE_54M, RATE_6M));
> > +	priv->top_ofdm_basic_rate = pos ? pos-- : RATE_24M;
>                                           ^^^^^
> Argh...  Come on.  I don't want to have to break out the C standard to
> see if this is defined behavior and where the sequence points are.  A
> pre-op would be clear but the most clear thing is to write it like this:
>
> 	priv->top_ofdm_basic_rate = pos ? (pos - 1) : RATE_24M;
>
Ok, I do the modification as you suggested and resend a new version.
>
> >
> > -	priv->top_cck_basic_rate = top_cck;
> > +	pos = fls(priv->basic_rates & GENMASK(RATE_11M, RATE_1M));
> > +	priv->top_cck_basic_rate = pos ? pos-- : RATE_1M;
>                                          ^^^^^
> Same.
>
> regards,
> dan carpenter
>
thanks,
oscar carter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ