lkml.org 
[lkml]   [2013]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] iio: Fix iio_channel_has_info
On 07/01/2013 03:20 PM, Alexandre Belloni wrote:
> Since the info_mask split, iio_channel_has_info() is not working correctly.
> info_mask_separate and info_mask_shared_by_type, it is not possible to compare
> them directly with the iio_chan_info_enum enum. Correct that bit using the BIT()
> macro.
>
> Cc: <stable@vger.kernel.org> # 3.10.x
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
ouch / oops is about all I can say to this one. Ideally might have had a note
in the description about what the effect of this bug is (breakage in the inkern interface)

Thanks and applied to the fixes-togreg branch of iio.git


> ---
> include/linux/iio/iio.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index 8d171f4..3d35b70 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -211,8 +211,8 @@ struct iio_chan_spec {
> static inline bool iio_channel_has_info(const struct iio_chan_spec *chan,
> enum iio_chan_info_enum type)
> {
> - return (chan->info_mask_separate & type) |
> - (chan->info_mask_shared_by_type & type);
> + return (chan->info_mask_separate & BIT(type)) |
> + (chan->info_mask_shared_by_type & BIT(type));
> }
>
> #define IIO_ST(si, rb, sb, sh) \
>


\
 
 \ /
  Last update: 2013-07-02 23:21    [W:0.834 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site