lkml.org 
[lkml]   [2020]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] overflow: Add __must_check attribute to check_*() helpers
On Wed, Aug 12, 2020 at 02:51:52PM -0700, Kees Cook wrote:
> +/*
> + * Allows to effectively us apply __must_check to a macro so we can have
> + * both the type-agnostic benefits of the macros while also being able to
> + * enforce that the return value is, in fact, checked.
> + */
> +static inline bool __must_check __must_check_bool(bool condition)
> +{
> + return unlikely(condition);
> +}

I'm fine with the concept, but this is a weirdly-generically-named
function that has a very specific unlikely() in it. So I'd call
this __must_check_overflow() and then it's obvious that overflow is
unlikely(), whereas it's not obvious that __must_check_bool() is going
to be unlikely().

\
 
 \ /
  Last update: 2020-08-13 13:25    [W:1.081 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site