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:	Wed, 26 Feb 2014 08:29:22 +0000
From:	Lee Jones <lee.jones@...aro.org>
To:	Sebastian Reichel <sre@...ian.org>
Cc:	Sebastian Reichel <sre@...g0.de>,
	Marek Belisko <marek@...delico.com>,
	Jonathan Cameron <jic23@...nel.org>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Grant Likely <grant.likely@...aro.org>,
	linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
	linux-iio@...r.kernel.org
Subject: Re: [RFCv3 3/7] mfd: twl4030-madc: Cleanup driver

> Some style fixes in twl4030-madc driver.
> 
> Reported-by: Jonathan Cameron <jic23@...nel.org>
> Signed-off-by: Sebastian Reichel <sre@...ian.org>
> ---
>  drivers/mfd/twl4030-madc.c       | 108 ++++++++++++++++++---------------------
>  include/linux/i2c/twl4030-madc.h |   2 +-
>  2 files changed, 51 insertions(+), 59 deletions(-)
> 
> diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c
> index 81484ee..c23025b 100644
> --- a/drivers/mfd/twl4030-madc.c
> +++ b/drivers/mfd/twl4030-madc.c

>  /*
> - * Return battery temperature
> + * Return battery temperature in degree Celsius

degrees

<snip>

> -	int count = 0, count_req = 0, i;
> -	u8 reg;
> +	int count = 0, i;

Ugly, please declare on separate lines.

>  	for_each_set_bit(i, &channels, TWL4030_MADC_MAX_CHANNELS) {
> -		reg = reg_base + 2 * i;

Odd for this to be removed, as you calculate more than once now.

> -		buf[i] = twl4030_madc_channel_raw_read(madc, reg);
> +		buf[i] = twl4030_madc_channel_raw_read(madc, reg_base + 2 * i);

Better to bracket the math for clarity.

<snip>

> +			dev_err(madc->dev, "Unable to read register 0x%X\n",
> +				reg_base + 2 * i);

Here's the other calculation.

> +	regmask = (chan == 0) ? TWL4030_BCI_TYPEN : TWL4030_BCI_ITHEN;

regmask = chan ? TWL4030_BCI_ITHEN : TWL4030_BCI_TYPEN; 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
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