From: Andrzej Hajda <a.hajda@samsung.com>
To: David Miller <davem@davemloft.net>
Cc: tom@herbertland.com, b.zolnierkie@samsung.com,
m.szyprowski@samsung.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kcm: fix variable type
Date: Mon, 14 Mar 2016 07:45:44 +0100 [thread overview]
Message-ID: <56E65E18.1050907@samsung.com> (raw)
In-Reply-To: <20160311.114442.1933815095495449507.davem@davemloft.net>
On 03/11/2016 05:44 PM, David Miller wrote:
> From: Andrzej Hajda <a.hajda@samsung.com>
> Date: Fri, 11 Mar 2016 07:51:15 +0100
>
>> Function skb_splice_bits can return negative values, its result should
>> be assigned to signed variable to allow correct error checking.
>>
>> The problem has been detected using patch
>> scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci.
>>
>> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> Since skb_splice_bits() returns an 'int', that would be a more appropriate
> type to use here.
>
> Thank you.
>
>
On the other side kcm_splice_read use this local var as return variable,
and the return type is ssize_t.
Digging deeper it looks like:
ssize_t kcm_splice_read(...) returns result of
int skb_splice_bits(...) which returns result of
ssize_t splice_cb(...) callback.
It looks code is somehow inconsistent, but maybe there are other reasons
which I am not aware of.
Regards
Andrzej
prev parent reply other threads:[~2016-03-14 6:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 6:51 [PATCH] kcm: fix variable type Andrzej Hajda
2016-03-11 16:44 ` David Miller
2016-03-14 6:45 ` Andrzej Hajda [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=56E65E18.1050907@samsung.com \
--to=a.hajda@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=netdev@vger.kernel.org \
--cc=tom@herbertland.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