Linux Input Archive mirror
 help / color / mirror / Atom feed
From: Stefan Berzl <stefanberzl@gmail.com>
To: Nikolai Kondrashov <spbnick@gmail.com>, Jiri Kosina <jikos@kernel.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] HID: uclogic: Remove useless loop
Date: Thu, 18 Apr 2024 20:46:09 +0200	[thread overview]
Message-ID: <d26436f0-b85e-4102-a3b3-a31816f0452d@gmail.com> (raw)
In-Reply-To: <f2429c78-9189-410d-9c6a-644ae8a4d12c@gmail.com>

Hi!

On 18/04/2024 19:04, Nikolai Kondrashov wrote:
> Hi Jiri, Stefan,
> 
> On 4/18/24 4:31 PM, Stefan Berzl wrote:
>>
>> On 12/04/2024 17:52, Jiri Kosina wrote:
>>> On Mon, 1 Apr 2024, Stefan Berzl wrote:
>>>
>>>> The while in question does nothing except provide the possibility
>>>> to have an infinite loop in case the subreport id is actually the same
>>>> as the pen id.
>>>>
>>>> Signed-off-by: Stefan Berzl <stefanberzl@gmail.com>
>>>
>>> Let me CC Nicolai, the author of the code of question (8b013098be2c9).
>>
>> I agree that Nicolai's opinion would be invaluable, but even without it,
>> the patch is trivially correct. If we have a subreport that matches the
>> packet, we change the report_id accordingly. If we then loop back to the
>> beginning, either the report_id is different or we are caught in an
>> infinite loop. None of these are hardware registers where the access
>> itself would matter.
> 
> Yes, Stefan is right. I was trying to implement general rewrite logic, and if
> we really had that, then the fix would need to be checking that the new ID is
> different. As such there's really no need, and Stefan's fix is fine.
> 
> Only perhaps amend that comment to something like
> 
>     /* Change to the (non-pen) subreport ID, and continue */
> 
> Or at least remove ", and restart".
> 

Will do! I'll send a v2 with the comment updated.

Regards

      reply	other threads:[~2024-04-18 18:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01  0:47 [PATCH] HID: uclogic: Remove useless loop Stefan Berzl
2024-04-12 15:52 ` Jiri Kosina
2024-04-18 13:31   ` Stefan Berzl
2024-04-18 17:04     ` Nikolai Kondrashov
2024-04-18 18:46       ` Stefan Berzl [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=d26436f0-b85e-4102-a3b3-a31816f0452d@gmail.com \
    --to=stefanberzl@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spbnick@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).