mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Mugilraj Dhavachelvan <dmugil2000@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] iio: accel: da280: Drop unnecessarily used braces
Date: Mon, 29 Mar 2021 12:54:58 +0200	[thread overview]
Message-ID: <57e6f6b4-8c8d-3039-a1fc-a8774110678d@redhat.com> (raw)
In-Reply-To: <CAHp75VdS=Px4MdhA5mzzqaQEsMs3ur76m+tYb1inVqBFfu_CRA@mail.gmail.com>

Hi,

On 3/29/21 12:52 PM, Andy Shevchenko wrote:
> +Cc: Hans (just for your opinion)
> 
> On Sun, Mar 28, 2021 at 10:40 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
>> On Sunday, March 28, 2021, Mugilraj Dhavachelvan <dmugil2000@gmail.com> wrote:
>>>
>>> As per linux kernel coding style braces are not needed for single
>>> statement.
>>> Checkpatch
>>> warning: braces {} are not necessary for any arm of this statement
>>> 128: FILE: drivers/iio/accel/da280.c:128:
>>>
>>
>> While it’s the correct patch, I would rather recommend making the driver non-ACPI centric. I.e.:
>> - replace that custom function by device_get_match_data() call
>>
>> - replace that condition by something like
>> type = device_get_match_data();
>>
>> - drop ACPI_PTR()
>>
>> - replace acpi.h by mod_devicetable.h and property.h
>>
>> - convert to use ->probe_new()
>>
>>
>>  Everything, except the last one is in one patch, the last one is another patch.

I agree that *carefully* converting to driver to device_get_match_data() would be good.

Regards,

Hans


>>
>>
>>
>>> Signed-off-by: Mugilraj Dhavachelvan <dmugil2000@gmail.com>
>>> ---
>>>  drivers/iio/accel/da280.c | 5 ++---
>>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/iio/accel/da280.c b/drivers/iio/accel/da280.c
>>> index 227bea2d738b..31f290ae4386 100644
>>> --- a/drivers/iio/accel/da280.c
>>> +++ b/drivers/iio/accel/da280.c
>>> @@ -125,11 +125,10 @@ static int da280_probe(struct i2c_client *client,
>>>         indio_dev->modes = INDIO_DIRECT_MODE;
>>>         indio_dev->channels = da280_channels;
>>>
>>> -       if (ACPI_HANDLE(&client->dev)) {
>>> +       if (ACPI_HANDLE(&client->dev))
>>>                 chip = da280_match_acpi_device(&client->dev);
>>> -       } else {
>>> +       else
>>>                 chip = id->driver_data;
>>> -       }
>>>
>>>         if (chip == da226) {
>>>                 indio_dev->name = "da226";
> 


      reply	other threads:[~2021-03-29 10:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-28 18:01 Mugilraj Dhavachelvan
     [not found] ` <CAHp75Vdv4zAsn_v1TaUcYgY_PpQrfhfGNsc8=QTbPY=oFN_xbA@mail.gmail.com>
2021-03-29 10:52   ` Andy Shevchenko
2021-03-29 10:54     ` Hans de Goede [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57e6f6b4-8c8d-3039-a1fc-a8774110678d@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=dmugil2000@gmail.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®