lkml.org 
[lkml]   [2021]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH/RFC 10/17] media: ti-vpe: cal: Use bitfield helpers
    Date
    Use the field_prep() helper, instead of open-coding the same operation.

    Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
    ---
    Compile-tested only.
    Marked RFC, as this depends on [PATCH 01/17], but follows a different
    path to upstream.
    ---
    drivers/media/platform/ti-vpe/cal.h | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/drivers/media/platform/ti-vpe/cal.h b/drivers/media/platform/ti-vpe/cal.h
    index 527e22d022f300b7..5fcf1b55ff2879ac 100644
    --- a/drivers/media/platform/ti-vpe/cal.h
    +++ b/drivers/media/platform/ti-vpe/cal.h
    @@ -303,7 +303,7 @@ static inline void cal_write_field(struct cal_dev *cal, u32 offset, u32 value,
    u32 val = cal_read(cal, offset);

    val &= ~mask;
    - val |= (value << __ffs(mask)) & mask;
    + val |= field_prep(mask, value);
    cal_write(cal, offset, val);
    }

    @@ -312,7 +312,7 @@ static inline void cal_set_field(u32 *valp, u32 field, u32 mask)
    u32 val = *valp;

    val &= ~mask;
    - val |= (field << __ffs(mask)) & mask;
    + val |= field_prep(mask, field);
    *valp = val;
    }

    --
    2.25.1
    \
     
     \ /
      Last update: 2021-11-22 16:56    [W:2.792 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site