From: Dmitry Osipenko <digetx@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jiada Wang <jiada_wang@mentor.com>,
nick@shmanahar.org, Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input <linux-input@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Eugeniu Rosca <erosca@de.adit-jv.com>,
Andrew_Gabbasov@mentor.com
Subject: Re: [PATCH v4 1/1] Input: atmel_mxt_ts - implement I2C retries
Date: Mon, 14 Sep 2020 18:26:25 +0300 [thread overview]
Message-ID: <137be969-f99a-66e0-ebe4-b86f4be2b5d3@gmail.com> (raw)
In-Reply-To: <CAHp75VdTv-uCQue3VU=czZJd4iTG+XBVe2kFtnP+fZ1XQuFbzA@mail.gmail.com>
14.09.2020 16:49, Andy Shevchenko пишет:
> On Sun, Sep 13, 2020 at 3:57 PM Dmitry Osipenko <digetx@gmail.com> wrote:
>>
>> 13.09.2020 11:43, Andy Shevchenko пишет:
>>> ...
>>>
>>>> + bool retried = false;
>>
>>> I thought Dmitry wants that to be retry
>>
>> In the comment to v2 you suggested to negate the condition,
>
> Where? I just checked a few messages before and I found that I asked
> the same question: why is negative conditional used instead of
> positive.
I'm reading this as imperative "make it positive", and thus, assumed
that you asked to do so because the "retry" implies a positive
condition, while "retried" implies the negative.
If you've added "Could you please explain why", then I'd read it as a
question.
>> hence I
>> thought it's YOU who wants it to be retried.
>
> I see. Let's see how it goes with positive conditionals first.
>
>
>> The "retried" is a very common form among kernel drivers, so it's good
>> to me.
>>
>>>> u8 buf[2];
>>>> int ret;
>>>
>>>> - ret = i2c_transfer(client->adapter, xfer, 2);
>>>> - if (ret == 2) {
>>>> - ret = 0;
>>>> - } else {
>>>> - if (ret >= 0)
>>>> - ret = -EIO;
>>>> +retry_read:
>>>
>>>> + ret = i2c_transfer(client->adapter, xfer, ARRAY_SIZE(xfer));
>>>> + if (ret != ARRAY_SIZE(xfer)) {
>> ...> Also why switch from positive to negative conditional?
>>
>> This will make code less readable because of the goto, and thus, there
>> will be two branches for handling of the returned value instead of one +
>> goto. Hence this part is good to me as-is.
>
> But it's not the purpose of this patch, right?
> Style changes should be really separated from the fix.
This should be up to a particular maintainer to decide. Usually nobody
requires patches to be overly pedantic, this may turn away contributors
because it feels like an unnecessary bikeshedding. It's more preferred
to accept patch as-is if it does right thing and then maintainer could
modify the patch, making cosmetic changes.
> And since it's a fix it should have a Fixes tag.
It shouldn't be a fix, but a new feature because apparently the 1386
controller wasn't ever intended to be properly supported before this patch.
next prev parent reply other threads:[~2020-09-14 15:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-12 0:55 [PATCH v4 1/1] Input: atmel_mxt_ts - implement I2C retries Jiada Wang
2020-09-13 8:43 ` Andy Shevchenko
2020-09-13 12:57 ` Dmitry Osipenko
2020-09-14 13:49 ` Andy Shevchenko
2020-09-14 15:26 ` Dmitry Osipenko [this message]
2020-09-14 15:50 ` Andy Shevchenko
2020-09-14 16:28 ` Dmitry Osipenko
2020-09-13 16:56 ` Dmitry Torokhov
2020-09-14 17:29 ` Dmitry Osipenko
2020-09-14 19:33 ` Dmitry Torokhov
2020-09-14 19:36 ` Dmitry Torokhov
2020-09-14 21:33 ` Dmitry Osipenko
2020-09-14 22:32 ` Dmitry Torokhov
2020-09-15 1:13 ` Rob Herring
2020-09-15 15:55 ` Wang, Jiada
2020-09-15 17:40 ` Dmitry Osipenko
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=137be969-f99a-66e0-ebe4-b86f4be2b5d3@gmail.com \
--to=digetx@gmail.com \
--cc=Andrew_Gabbasov@mentor.com \
--cc=andy.shevchenko@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=erosca@de.adit-jv.com \
--cc=jiada_wang@mentor.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nick@shmanahar.org \
/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