lkml.org 
[lkml]   [2015]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 6/6] Staging: iio: resolver: Prefer using the BIT macro
    Date
    This patch replaces bit shifting on 1 with the BIT(x) macro
    as it's extensively used by other function in this driver.

    This was done with coccinelle:
    @@ int g; @@

    -(1 << g)
    +BIT(g)

    Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
    ---
    drivers/staging/iio/resolver/ad2s1210.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c
    index 7bc3e4a..1cf7134 100644
    --- a/drivers/staging/iio/resolver/ad2s1210.c
    +++ b/drivers/staging/iio/resolver/ad2s1210.c
    @@ -149,7 +149,7 @@ int ad2s1210_update_frequency_control_word(struct ad2s1210_state *st)
    int ret;
    unsigned char fcw;

    - fcw = (unsigned char)(st->fexcit * (1 << 15) / st->fclkin);
    + fcw = (unsigned char)(st->fexcit * BIT(15) / st->fclkin);
    if (fcw < AD2S1210_MIN_FCW || fcw > AD2S1210_MAX_FCW) {
    dev_err(&st->sdev->dev, "ad2s1210: FCW out of range\n");
    return -ERANGE;
    --
    2.1.4


    \
     
     \ /
      Last update: 2015-09-10 06:41    [W:3.624 / U:0.396 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site