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: <20181202173854.GG10650@smile.fi.intel.com>
Date:   Sun, 2 Dec 2018 19:38:54 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Jonathan Cameron <jic23@...nel.org>
Cc:     Darren Hart <dvhart@...radead.org>,
        platform-driver-x86@...r.kernel.org,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        linux-acpi@...r.kernel.org, Wolfram Sang <wsa@...-dreams.de>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        linux-i2c@...r.kernel.org, Hans de Goede <hdegoede@...hat.com>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 02/15] platform/x86: intel_cht_int33fe: Accept errors
 of i2c_acpi_new_device()

On Sun, Dec 02, 2018 at 03:56:06PM +0000, Jonathan Cameron wrote:
> On Wed, 28 Nov 2018 13:45:22 +0200
> Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:

> > In the future i2c_acpi_new_device() will return error pointer in some cases.
> > Prepare intel_cht_int33fe driver to support that.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> > Reviewed-by: Hans de Goede <hdegoede@...hat.com>
> 
> Really trivial comment inline.  I haven't checked back to see if there
> has been any previous discussion on that bit of code.
> 
> Otherwise looks sensible to me.

> >  		data->max17047 = i2c_acpi_new_device(dev, 1, &board_info);
> > -		if (!data->max17047)
> > -			return -EPROBE_DEFER; /* Wait for i2c-adapter to load */
> > +		if (IS_ERR(data->max17047))
> > +			ret = PTR_ERR(data->max17047);
> Every so slightly nicer to just return directly in these error cases?
> > +		else if (!data->max17047)
> > +			ret = -EPROBE_DEFER; /* Wait for i2c-adapter to load */
> > +		else
> > +			ret = 0;

> Particularly so as then you don't need to set this ret as it's set in all
> paths where it is used below anyway...

It doesn't matter much, since the logically it's split to 3 stages:
- preparation
- change API
- drop obsoleted pieces of code

This one is preparation stage. After 3rd stage it will be as you suggested.

> > +		if (ret)
> > +			return ret;

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ