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: <20151119075132.GT18797@mwanda>
Date:	Thu, 19 Nov 2015 10:51:32 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Ian Abbott <abbotti@....co.uk>
Cc:	Ranjith Thangavel <ranjithece24@...il.com>,
	gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] comedi: dmm32at: Fix coding style - use BIT macro

On Wed, Nov 18, 2015 at 04:26:52PM +0000, Ian Abbott wrote:
> >+#define DMM32AT_AI_CFG_SCINT_10US	(BIT(5) & ~BIT(4))
> >+#define DMM32AT_AI_CFG_SCINT_5US	(BIT(5) | BIT(4))
> 
> The values of DMM32AT_AI_CFG_SCINT_20US etc. are numerically
> correct, but look a bit strange.  The `(BIT(5) & ~BIT(4))` looks
> especially strange and could be changed to `BIT(5)`.  These are all
> really shifted 2-bit values, so perhaps the BIT() macro isn't the
> best representation.
> 

BIT(5) & ~BIT(4) is silly.  Don't do that.

The original code was fine.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ