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: <3547278.d3Q4LvxEgy@wuerfel>
Date:	Thu, 02 May 2013 15:42:19 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	devicetree-discuss@...ts.ozlabs.org
Cc:	Sascha Hauer <s.hauer@...gutronix.de>,
	Prabhakar Lad <prabhakar.csengg@...il.com>,
	DLOS <davinci-linux-open-source@...ux.davincidsp.com>,
	Mauro Carvalho Chehab <mchehab@...hat.com>,
	linux-doc@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
	Rob Herring <rob.herring@...xeda.com>,
	Hans Verkuil <hans.verkuil@...co.com>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Sylwester Nawrocki <s.nawrocki@...sung.com>,
	Sakari Ailus <sakari.ailus@....fi>,
	Guennadi Liakhovetski <g.liakhovetski@....de>,
	LMML <linux-media@...r.kernel.org>
Subject: Re: [PATCH RFC v2] media: i2c: mt9p031: add OF support

On Thursday 02 May 2013 08:55:18 Sascha Hauer wrote:
> > +#if defined(CONFIG_OF)
> > +static struct mt9p031_platform_data *
> > +     mt9p031_get_pdata(struct i2c_client *client)
> > +
> > +{
> > +     if (client->dev.of_node) {
> 
> By inverting the logic here and returning immediately you can safe an
> indention level for the bulk of this function.

Right, also make this

	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
		return client->dev.platform_data;

Then the rest of the function gets discarded by the compiler when CONFIG_OF
is not set, and you can kill the #ifdef around the function.

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