Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1475652 > unrolled thread
| Started by | Kalle Valo <kvalo@codeaurora.org> |
|---|---|
| First post | 2016-09-03 16:50 +0200 |
| Last post | 2016-09-03 16:50 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [v2] ErrHandling:Make IS_ERR_VALUE_U32 as generic API to avoid IS_ERR_VALUE abuses. Kalle Valo <kvalo@codeaurora.org> - 2016-09-03 16:50 +0200
| From | Kalle Valo <kvalo@codeaurora.org> |
|---|---|
| Date | 2016-09-03 16:50 +0200 |
| Subject | Re: [v2] ErrHandling:Make IS_ERR_VALUE_U32 as generic API to avoid IS_ERR_VALUE abuses. |
| Message-ID | <sdkqB-6qR-7@gated-at.bofh.it> |
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/
Back to top | Article view | linux.kernel
csiph-web