lkml.org 
[lkml]   [2022]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v2] include/uapi/linux/swab.h: move explicit cast outside ternary
    On Tue, Jun 7, 2022 at 5:14 PM Justin Stitt <jstitt007@gmail.com> wrote:
    >
    > A cast inside __builtin_constant_p doesn't do anything since it should evaluate
    > as constant at compile time irrespective of this cast. Instead, I moved this
    > cast outside the ternary to ensure the return type is as expected.
    >
    > For instance, if __HAVE_BUILTIN_BSWAP16__ was not defined then __swab16 is
    > actually returning an `int` not a `u16` due to integer promotion as described
    > by Nick in this thread. This has repercussions when building with clang

    Also, "this thread" won't make much sense when applied if someone is
    looking at git log. Consider phrasing this instead as "in the lore
    link below" then include another link tag to

    Link: https://lore.kernel.org/llvm/CAKwvOdmXeRbFjkHgFXps4pLH6Q6pGWRNOqA85=h2aFnR=uaggg@mail.gmail.com/

    Though, I think it's simply more concise to just include what Al said,
    and drop this sentence altogether. You can send me v3 privately as an
    RFC and I'll greenlight it before you resend to the list.
    --
    Thanks,
    ~Nick Desaulniers

    \
     
     \ /
      Last update: 2022-06-08 23:21    [W:6.170 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site