lkml.org 
[lkml]   [2023]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [alobakin:pfcp 5/20] drivers/iio/imu/adis16475.c:363 adis16475_set_freq() warn: set_bit() takes a bit number
    From
    From: Nuno Sá <noname.nuno@gmail.com>
    Date: Mon, 06 Nov 2023 13:02:58 +0100

    > On Mon, 2023-11-06 at 12:18 +0100, Alexander Lobakin wrote:
    >> From: Nuno Sá <noname.nuno@gmail.com>
    >> Date: Mon, 06 Nov 2023 11:07:16 +0100

    [...]

    >> assign_bit() does not take a bitmask as a first argument, but a bit number.
    >>
    >> I.e. if you want to switch BIT(0), you call it like assign_bit(0, ...),
    >> not assign_bit(BIT(0), ...). Same for the bit nr 1.
    >>
    >
    > Yes, I know... if you look at my reply to Dan you can see I realized that already :)

    Oh okay :)

    >
    > I guess by the time I first sent this time I didn't knew or maybe just a dumb
    > mistake...
    >
    > I'll send a patch later today removing the BIT() from the #define, thx!

    Nice! Don't forget the tags the build bot asked for :p

    BTW, I believe the reason why this warning triggered after my commit is
    that before it, assign_bit() is a static inline, but becomes a macro
    then. smatch becomes able to see through it that it indeed is a wrapper
    around set_bit()/clear_bit() and realizes the first argument is invalid.

    >
    > - Nuno Sá
    >

    Thanks,
    Olek

    \
     
     \ /
      Last update: 2023-11-20 13:50    [W:4.365 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site