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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 24 Feb 2014 10:00:41 -0800
From:	Bjorn Andersson <bjorn.andersson@...ymobile.com>
To:	Emilio L?pez <emilio@...pez.com.ar>
CC:	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>,
	Rob Landley <rob@...dley.net>,
	Wolfram Sang <wsa@...-dreams.de>,
	Grant Likely <grant.likely@...aro.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
	"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	Stephen Boyd <sboyd@...eaurora.org>,
	"Ivan T. Ivanov" <iivanov@...sol.com>,
	Andy Gross <agross@...eaurora.org>
Subject: Re: [PATCH v3 2/2] i2c: New bus driver for the Qualcomm QUP I2C
 controller

On Thu 20 Feb 18:53 PST 2014, Emilio L?pez wrote:

> Hi Bjorn,
> 
> El 20/02/14 21:38, Bjorn Andersson escribió:
[...]
> > +	clk_freq = 100000;
> > +	if (!of_property_read_u32(node, "clock-frequency", &val))
> > +		clk_freq = val;
> 
> val will be modified only if no error occurs, so you may rewrite this 
> bit as
> 
> +	u32 clk_freq = 100000;
> ...
> +	of_property_read_u32(node, "clock-frequency", &clk_freq)

Seems the two conventions used in the kernel is either your proposal or "if
fail the assign default". So I'll change this.

> 
> > +
> > +	/* We support frequencies up to FAST Mode (400KHz) */
> > +	if (clk_freq <= 0 || clk_freq > 400000) {
> 
> And you can drop the < check when it's unsigned.

Indeed!

> 
> > +		dev_err(qup->dev, "clock frequency not supported %d\n",
> > +			clk_freq);
> > +		return -EIO;
> 
> EIO?

EINVAL

> 
> Cheers,
> 
> Emilio

Thanks,
Bjorn
--
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