From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Luis de Bethencourt <luisbg@osg.samsung.com>
Cc: linux-kernel@vger.kernel.org, jikos@kernel.org,
linux-usb@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [PATCH v2] HID: hiddev: change hiddev_connect() to return bool
Date: Tue, 20 Oct 2015 08:56:27 +0900 [thread overview]
Message-ID: <5625832B.9010908@samsung.com> (raw)
In-Reply-To: <5625083C.4000207@osg.samsung.com>
On 20.10.2015 00:11, Luis de Bethencourt wrote:
> On 13/10/15 02:49, Krzysztof Kozlowski wrote:
>> 2015-10-09 22:00 GMT+09:00 Luis de Bethencourt <luisbg@osg.samsung.com>:
>>> Since hid_connect() only cares about hiddev_connect() succeeding or
>>> failing, there is no need for this function to return an int and it can
>>> return a bool instead.
>>
>> It can return bool but it would not be in line with kernel coding
>> style. The hiddev_connect() I believe is an action, so "the function
>> should return an error-code integer.".
>>
>> Best regards,
>> Krzysztof
>>
>
>
> Hi Krysztof,
>
> The idea to switch the function to return bool was offered by Jiri Kosina,
> as a result of my initial patch changing the return errno code to ENOMEM.
I did not see the original comment from Jiri. Actually changing it to
ENOMEM makes more sense to me...
>
> Considering the return isn't propagated by the only consumer of the function,
> and your point about returning an integer being the kernel coding style. It
> doesn't make sense to change this function.
Jiri is the maintainer here but for me sticking to coding convention
(return errno) makes it easier to read.
Best regards,
Krzysztof
prev parent reply other threads:[~2015-10-19 23:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-09 13:00 [PATCH v2] HID: hiddev: change hiddev_connect() to return bool Luis de Bethencourt
2015-10-13 1:49 ` Krzysztof Kozlowski
2015-10-19 15:11 ` Luis de Bethencourt
2015-10-19 23:56 ` Krzysztof Kozlowski [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=5625832B.9010908@samsung.com \
--to=k.kozlowski@samsung.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=luisbg@osg.samsung.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 NNTP newsgroup(s).