From: Kalle Valo <kvalo@codeaurora.org>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: zajec5@gmail.com, viresh.kumar@linaro.org,
akpm@linux-foundation.org, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org, linville@tuxdriver.com,
Arvind Yadav <arvind.yadav.cs@gmail.com>
Subject: Re: [v2] ErrHandling:Make IS_ERR_VALUE_U32 as generic API to avoid IS_ERR_VALUE abuses.
Date: Sat, 3 Sep 2016 14:29:13 +0000 (UTC) [thread overview]
Message-ID: <20160903142913.16FBA6216D@smtp.codeaurora.org> (raw)
In-Reply-To: <1468083696-15283-1-git-send-email-arvind.yadav.cs@gmail.com>
Arvind Yadav <arvind.yadav.cs@gmail.com> wrote:
> IS_ERR_VALUE() assumes that its parameter is an unsigned long.
> It can not be used to check if an 'unsigned int' reflects an error.
> As they pass an 'unsigned int' into a function that takes an
> 'unsigned long' argument. This happens to work because the type
> is sign-extended on 64-bit architectures before it gets converted
> into an unsigned type.
>
> However, anything that passes an 'unsigned short' or 'unsigned int'
> argument into IS_ERR_VALUE() is guaranteed to be broken, as are
> 8-bit integers and types that are wider than 'unsigned long'.
>
> It would be nice to any users that are not passing 'unsigned int'
> arguments.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
This touches include/linux/err.h and I'm not very enthusiastic to change
anything in include directory without wider support. I recommend first to just
fix bcma. And separately you can try to improve linux/err.h via some more
approariate tree, not via wireless trees.
--
Sent by pwcli
https://patchwork.kernel.org/patch/9222139/
prev parent reply other threads:[~2016-09-03 14:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-09 17:01 [v2] ErrHandling:Make IS_ERR_VALUE_U32 as generic API to avoid IS_ERR_VALUE abuses Arvind Yadav
2016-09-03 14:29 ` Kalle Valo [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=20160903142913.16FBA6216D@smtp.codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=akpm@linux-foundation.org \
--cc=arvind.yadav.cs@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=viresh.kumar@linaro.org \
--cc=zajec5@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 NNTP newsgroup(s).