lkml.org 
[lkml]   [2017]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2] bitops: Avoid integer overflow in GENMASK(_ULL)
    On Thu,  3 Aug 2017 14:20:20 -0700 Matthias Kaehlcke <mka@chromium.org> wrote:

    > GENMASK(_ULL) performs a left-shift of ~0UL(L), which technically
    > results in an integer overflow. clang raises a warning if the overflow
    > occurs in a preprocessor expression.

    That's just irritaing.

    > Clear the low-order bits through
    > a substraction instead of the left-shift to avoid the overflow.

    There's no change in .text size for a few files I tested so guess we
    can live with it.


    \
     
     \ /
      Last update: 2017-08-03 23:48    [W:6.479 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site