lkml.org 
[lkml]   [2024]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [Lsf-pc] [LSF/MM/BPF TOPIC] tracing the source of errors
On Wed, 7 Feb 2024 at 13:00, Matthew Wilcox <willy@infradead.org> wrote:

> To be perfectly clear, you're suggesting two things.
>
> Option (a) change "all" code like this:
> - ret = -EINVAL;
> + ret = -ERR(EINVAL);
>
> where ERR would do some magic with __func__ and __LINE__.
>
> Option (b)
>
> -#define EINVAL 22
> +#define E_INVAL 22
> +#define EINVAL ERR(E_INVAL)
>
> and then change all code that does something like:
>
> if (err == -EINVAL)
> to
> if (err == -E_INVAL)
>
> Or have I misunderstood?

Something like that, yes.

Thanks,
Miklos

\
 
 \ /
  Last update: 2024-05-27 14:53    [W:0.115 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site