[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1510051616280.2758@pobox.suse.cz>
Date: Mon, 5 Oct 2015 16:24:08 +0200 (CEST)
From: Jiri Kosina <jikos@...nel.org>
To: Luis de Bethencourt <luisbg@....samsung.com>
cc: linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
linux-input@...r.kernel.org
Subject: Re: [PATCH] HID: hiddev: fix returned errno code in
hiddev_connect()
On Sat, 3 Oct 2015, Luis de Bethencourt wrote:
> > But I am not really sure where you are seeing the bug (mapping to
> > -EPERM) in this case? I think the only caller of hiddev_connect()
> > should be hid_connect(), and the only thing that guy cares about
> > whether individual callbacks succeed or fail, so that it sets
> > hdev->clamed flags accordingly.
> >
> > Could you please be more specific about the -EPERM mapping you are
> > talking about?
> >
> I agree with you. The only caller of hiddev_connect() only checks if the
> callback succeded. It checks if the return < 0.
> What I meant is that -1 means -EPERM. [0]
I still don't understand what problem you are chasing here, sorry. EPERM
is defined to be 1, yes. So are many other completely unrelated #defines.
> This patch is purely about the correctness of using -ENOMEM. The word
> "propagated" was not the best way to describe this problem. I could edit
> the commit message if you would like.
You seem to imply that someone might be interpreting that -1 as a define
from errno.h. But that's not the case.
Are you going to look at every 'return -1' occurence in the kernel and
convert it to something else? That can keep you busy for quite some time:
$ git grep 'return -1' | wc -l
9167
The only cleanup I'd imagine at least remotely possible in this case would
be to convert the ->connect() callbacks return bool.
--
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists