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: <55D20DC9.2060304@freescale.com>
Date:	Mon, 17 Aug 2015 09:37:29 -0700
From:	York Sun <yorksun@...escale.com>
To:	Wolfram Sang <wsa@...-dreams.de>
CC:	<linux-kernel@...r.kernel.org>, <linux-i2c@...r.kernel.org>,
	"Peter Korsgaard" <peter.korsgaard@...co.com>
Subject: Re: [PATCH] driver/i2c/mux: Add register based mux i2c-mux-reg



On 08/15/2015 01:23 PM, Wolfram Sang wrote:
> On Tue, Jun 16, 2015 at 10:28:12AM -0700, York Sun wrote:
>> Based on i2c-mux-gpio driver, similarly the register based mux
>> switch from one bus to another by setting a single register.
>> The register can be on PCIe bus, local bus, or any memory-mapped
>> address.
>>
>> Signed-off-by: York Sun <yorksun@...escale.com>
>> CC: Wolfram Sang <wsa@...-dreams.de>
>> CC: Peter Korsgaard <peter.korsgaard@...co.com>
> 
> Mostly good.
> 
>> +static int i2c_mux_reg_probe(struct platform_device *pdev)
>> +{
>> +	struct regmux *mux;
>> +	struct i2c_adapter *parent;
>> +	struct resource *res;
>> +	int (*deselect)(struct i2c_adapter *, void *, u32);
>> +	unsigned int initial_state, class;
> 
> gcc says:
> 
> drivers/i2c/muxes/i2c-mux-reg.c:182:15: warning: variable 'initial_state' set but not used [-Wunused-but-set-variable]
> 
> It seens you prepared for setting the initial state but don't do the
> actual set?

Thanks for catching this. I set the initial state variable but used another
variable when it is actually used. Kernel Makefile disables
unused-but-set-variable by default. How did you enable this warning without
being flooded by the warnings? (I tried W=1)

> 
>> +static struct platform_driver i2c_mux_reg_driver = {
>> +	.probe	= i2c_mux_reg_probe,
>> +	.remove	= i2c_mux_reg_remove,
>> +	.driver	= {
>> +		.owner	= THIS_MODULE,
> 
> coccicheck says:
> 
> drivers/i2c/muxes/i2c-mux-reg.c:288:3-8: No need to set .owner here. The core will do it.

Will drop it in next version.

York
--
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