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: <575A988F.9060408@mev.co.uk>
Date:	Fri, 10 Jun 2016 11:38:07 +0100
From:	Ian Abbott <abbotti@....co.uk>
To:	Ravishankar Karkala Mallikarjunayya <ravishankarkm32@...il.com>,
	hsweeten@...ionengravers.com, gregkh@...uxfoundation.org
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] Staging: comedi: dmm32at: fix BIT macro issue.

On 09/06/16 13:04, Ravishankar Karkala Mallikarjunayya wrote:
> This Replace all occurences of (1<<x) by BIT(x) and DMM32AT_CTRL(x),
> DMM32AT_AI_CFG(x) macros to get rid of checkpatch.pl
> "CHECK" output "Prefer using the BIT macro"
>
> Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@...il.com>
> ---
>   drivers/staging/comedi/drivers/dmm32at.c | 98 ++++++++++++++++----------------
>   1 file changed, 50 insertions(+), 48 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c
> index 958c0d4..0d50105 100644
> --- a/drivers/staging/comedi/drivers/dmm32at.c
> +++ b/drivers/staging/comedi/drivers/dmm32at.c
[snip]
> -#define DMM32AT_CTRL_RESETA		(1 << 5)
> -#define DMM32AT_CTRL_RESETD		(1 << 4)
> -#define DMM32AT_CTRL_INTRST		(1 << 3)
> -#define DMM32AT_CTRL_PAGE_8254		(0 << 0)
> -#define DMM32AT_CTRL_PAGE_8255		(1 << 0)
> -#define DMM32AT_CTRL_PAGE_CALIB		(3 << 0)
> +#define DMM32AT_CTRL_RESETA		BIT(5)
> +#define DMM32AT_CTRL_RESETD		BIT(4)
> +#define DMM32AT_CTRL_INTRST		BIT(3)
> +#define DMM32AT_CTRL(x)			((x) << 0)
> +#define DMM32AT_CTRL_PAGE_8254		DMM32AT_CTRL(0)
> +#define DMM32AT_CTRL_PAGE_8255		DMM32AT_CTRL(1)
> +#define DMM32AT_CTRL_PAGE_CALIB		DMM32AT_CTRL(3)

The macro name DMM32AT_CTRL(x) is not specific enough.  It should be 
DMM32AT_CTRL_PAGE(x) to match the names of the macros that use it 
(DMM32AT_CTRL_PAGE_8254 etc.).

[snip]
> -#define DMM32AT_AI_CFG_SCINT_20US	(0 << 4)
> -#define DMM32AT_AI_CFG_SCINT_15US	(1 << 4)
> -#define DMM32AT_AI_CFG_SCINT_10US	(2 << 4)
> -#define DMM32AT_AI_CFG_SCINT_5US	(3 << 4)
> -#define DMM32AT_AI_CFG_RANGE		(1 << 3)  /* 0=5V  1=10V */
> -#define DMM32AT_AI_CFG_ADBU		(1 << 2)  /* 0=bipolar  1=unipolar */
> +#define DMM32AT_AI_CFG(x)		((x) << 4)
> +#define DMM32AT_AI_CFG_SCINT_20US	DMM32AT_AI_CFG(0)
> +#define DMM32AT_AI_CFG_SCINT_15US	DMM32AT_AI_CFG(1)
> +#define DMM32AT_AI_CFG_SCINT_10US	DMM32AT_AI_CFG(2)
> +#define DMM32AT_AI_CFG_SCINT_5US	DMM32AT_AI_CFG(3)

The same thing here.  Please rename DMM32AT_AI_CFG(x) to 
DMM32AT_AI_CFG_SCINT(x).

(Don't forget to update the patch description to match these changes.)

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@....co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ