lkml.org 
[lkml]   [2020]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v1] driver core: Annotate dev_err_probe() with __must_check
From
Date
Hi Andy,

On 26.08.2020 12:44, Andy Shevchenko wrote:
> We have got already new users of this API which interpret it differently
> and miss the opportunity to optimize their code.
>
> In order to avoid similar cases in the future, annotate dev_err_probe()
> with __must_check.


There are many cases where __must_check can be annoying, for example:

ret = ...;

if (ret < 0) {

    dev_err_probe(...);

    goto cleanup;

}


Or (less frequently):

ptr = ...;

if (IS_ERR(ptr)) {

    dev_err_probe(...);

    return ptr;

}


Of course in both cases one can add workarounds, but I am not sure what
is better.


Regards

Andrzej


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