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]
Message-ID: <3285547.78o0xYBaXq@titan>
Date:	Tue, 15 Oct 2013 01:26:16 +0200
From:	Maximilian Güntner 
	<maximilian.guentner@...il.com>
To:	Peter Meerwald <pmeerw@...erw.net>
Cc:	Bryan Wu <cooloney@...il.com>, Richard Purdie <rpurdie@...ys.net>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	linux-leds <linux-leds@...r.kernel.org>
Subject: Re: [PATCH] leds: Added driver for the NXP PCA9685 I2C chip

On Tuesday 15 October 2013 00:38:13 Peter Meerwald wrote:
> > The NXP PCA9685 supports 16 channels/leds using a 12-bit PWM (4095
> > levels of brightness)
> > This driver supports configuration using platform_data.
> 
> some nitpicking inline
Thank you for your comments.
> chip
fixed.
> 
>> + * Driver for the NXP PCA9685 12-Bit I2C chip.
> this could be more descriptive: 12-bit PWM LED driver chip
fixed.
> > +	/*
> > +	 * 4095 is the maximum brightness, so we set the ON time to 0x1000
> > +	 * which disables the PWM generator for that LED
> > +	 */
> > +	if (pca9685->brightness == 4095)
> > +		brightness = 4096;
> 
> why not check for 4095 instead of 4096 below and save this if statement?
removed.

I left it there in order to improve the code readability, which should be equally
good when we just remove the statement and check for 4095 below.
> > +	i2c_smbus_write_byte_data(client, PCA9685_MODE1, 1 << PCA9685_AI);
> 
> maybe BIT(PCA9685_AI)
replaced.
--
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