[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b3fdf17d-ac3d-bb6b-53a5-be4a93ce69e1@gmail.com>
Date: Tue, 1 Dec 2020 22:11:41 +0000
From: Dan Scally <djrscally@...il.com>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc: linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-i2c@...r.kernel.org,
linux-media@...r.kernel.org, devel@...ica.org, rjw@...ysocki.net,
lenb@...nel.org, gregkh@...uxfoundation.org,
mika.westerberg@...ux.intel.com, andriy.shevchenko@...ux.intel.com,
linus.walleij@...aro.org, bgolaszewski@...libre.com,
wsa@...nel.org, yong.zhi@...el.com, sakari.ailus@...ux.intel.com,
bingbu.cao@...el.com, tian.shu.qiu@...el.com, mchehab@...nel.org,
robert.moore@...el.com, erik.kaneda@...el.com, pmladek@...e.com,
rostedt@...dmis.org, sergey.senozhatsky@...il.com,
linux@...musvillemoes.dk, kieran.bingham+renesas@...asonboard.com,
jacopo+renesas@...ndi.org,
laurent.pinchart+renesas@...asonboard.com,
jorhand@...ux.microsoft.com, kitakar@...il.com,
heikki.krogerus@...ux.intel.com
Subject: Re: [PATCH 13/18] ipu3-cio2: Add functionality allowing software_node
connections to sensors on platforms designed for Windows
On 01/12/2020 22:08, Dan Scally wrote:
>>> +
>>> + for_each_acpi_dev_match(adev, this_device, NULL, -1) {
>>> + if (!adev || !(adev->status.present && adev->status.enabled))
>> if (!adev || !adev->status.present || !adev->status.enabled))
>>
>> may be a bit more readable. Does for_each_acpi_dev_match() return NULL
>> devices though ? If no, you could drop the !adev check. You may also be
>> able to drop the !present check, as I don't think ACPI allows !present
>> && enabled.
> You're right, the spec mandates enabled be 0 if present is 0. The
> iterator will return NULL when the previous return value was the last
> matching device, so that part needs to stay, but it can become:
>
> if (!adev || !adev->status.enabled)
>
Wait, that's silly, the loop won't start if the check is null so you're
right of course.
Powered by blists - more mailing lists