lkml.org 
[lkml]   [2020]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [GIT PULL] HID fixes
On Thu, Jan 9, 2020 at 6:23 AM Jiri Kosina <jikos@kernel.org> wrote:
>
> - _poll API fixes for hidraw, from Marcel Holtmann

Why is this bogus thing sent to me as a "fix"?

It's breaking things AGAIN.

Guys, doing this is *WRONG*:

if (readable)
return "it's readable";
if (error)
return "there's some error";
return "it's writable";

Seriously. Think about _why_ the above is wrong for five seconds please (*).

That "fix" actually introduces a bug, and the code is complete
garbage. It wasn't pretty before, but it was _less_ garbage before.

We had the exact same thing in the uinput layer recently, and it was
buggy then too.

That was Marcel that time too. And he was Cc'd on the fix back then
too, but still THIS SAME BUG gets introduced a month later in the HID
layer.

See

https://lore.kernel.org/lkml/20191209202254.GA107567@dtor-ws/

for details, even if I haven't gotten a pull request from Dmitry since.

I've merged this HID code, BUT IT IS WRONG. Stop doing this mistake
over and over again, even when told otherwise.

I expect to see a fix, and I expect people to start thinking about it.
And Marcel, since you were told it was buggy once, why didn't you then
inform Jiri that you had sent *him* the same buggy code? How many
other people have you sent that buggy patch to without then informing
them that it was completely bogus?

Linus

(*) If thinking about it for five seconds didn't help, then let me
just give a big clue-bat: "what if it's both readable and writable,
but the user only cares about the writable part"?

Poll is a *set* of conditions. Not just one.

\
 
 \ /
  Last update: 2020-01-09 20:20    [W:0.072 / U:4.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site