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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 4 Apr 2019 12:09:00 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Madhumitha Prabakaran <madhumithabiw@...il.com>
Cc:     gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] Staging: rtlwifi: Remove unwanted parentheses

You should probably update the subject line because now it's not just
about parentheses any more.

[PATCH v2] Staging: rtlwifi: clean up crc16_ccitt()

So the one thing per patch rule is a little bit about selling your
patch.  We never allow "Clean up whole_file.c" but we do sometimes allow
"Clean up a function()" so long as the patch description sells it in
the right way.

Blah blah function does "BIT(0) << i" instead of "BIT(i)".  Using !!
is slightly shorter than "foo ? 1 : 0".  Blah blah, etc.

On Wed, Apr 03, 2019 at 05:38:51PM -0500, Madhumitha Prabakaran wrote:
> @@ -351,13 +351,13 @@ static u16 crc16_ccitt(u8 data, u16 crc)
>  		else
>  			result |= BIT(0);
>  
> -		crc_bit11 = ((crc & BIT(11)) ? 1 : 0) ^ shift_in;
> +		crc_bit11 = !!(crc & BIT(11)) ^ shift_in;
>  		if (crc_bit11 == 0)
>  			result &= (~BIT(12));
                                  ^        ^
I thought your Coccinelle script was going to complain about these
parentheses.  Probably the &= confuses it?  There are a couple others
in the same function.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ