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:	Thu, 3 Apr 2014 09:10:04 +0200
From:	Wolfram Sang <wsa@...-dreams.de>
To:	Michal Simek <monstr@...str.eu>
Cc:	Soren Brinkmann <soren.brinkmann@...inx.com>,
	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>,
	Russell King <linux@....linux.org.uk>,
	Michal Simek <michal.simek@...inx.com>,
	Grant Likely <grant.likely@...aro.org>,
	Mike Looijmans <mike.looijmans@...ic.nl>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-doc@...r.kernel.org, devicetree@...r.kernel.org,
	linux-i2c@...r.kernel.org, Harini Katakam <harinik@...inx.com>
Subject: Re: [PATCH v3 1/2] i2c: Add driver for Cadence I2C controller


Please don't quote large parts of the message f you are not referring to
it.

> > +#ifdef CONFIG_PM_SLEEP
> > +/**
> > + * cdns_i2c_suspend - Suspend method for the driver
> > + * @_dev:	Address of the platform_device structure
> > + * Return: 0 always
> > + *
> > + * Put the driver into low power mode.
> > + */
> > +static int cdns_i2c_suspend(struct device *_dev)
> > +{
> > +	struct platform_device *pdev = container_of(_dev,
> > +			struct platform_device, dev);
> > +	struct cdns_i2c *xi2c = platform_get_drvdata(pdev);
> > +
> > +	clk_disable(xi2c->clk);
> > +	xi2c->suspended = 1;
> > +
> > +	return 0;
> > +}
> > +
> > +/**
> > + * cdns_i2c_resume - Resume from suspend
> > + * @_dev:	Address of the platform_device structure
> > + * Return: 0 on success and error value on error
> > + *
> > + * Resume operation after suspend.
> > + */
> > +static int cdns_i2c_resume(struct device *_dev)
> > +{
> > +	struct platform_device *pdev = container_of(_dev,
> > +			struct platform_device, dev);
> > +	struct cdns_i2c *xi2c = platform_get_drvdata(pdev);
> > +	int ret;
> > +
> > +	ret = clk_enable(xi2c->clk);
> > +	if (ret) {
> > +		dev_err(_dev, "Cannot enable clock.\n");
> > +		return ret;
> > +	}
> > +
> > +	xi2c->suspended = 0;
> > +
> > +	return 0;
> > +}
> > +#endif
> 
> Can you also please remove this #ifdef and use __maybe_used
> instead? Better not to have any ifdef in the code.

Is this a new pattern? For PM_SLEEP, #ifdef seems to be quite common.


Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ