lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 24 Jul 2016 15:17:51 +0200
From:	walter harms <wharms@....de>
To:	Julia Lawall <julia.lawall@...6.fr>
CC:	kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: is_err checking



Am 23.07.2016 16:56, schrieb Julia Lawall:
> Code like the following looks a bit clunky to me:
> 
> if (IS_ERR(data->clk) && PTR_ERR(data->clk) != -EPROBE_DEFER)
> 
> Is there any reason not to always use eg
> 
> data->clk == ERR_PTR(-EPROBE_DEFER)
> 
> Code of the latter form is a bit more popular.  Perhaps one could want
> something like:
> 
> IS_ERR_VALUE(data->clk, -EPROBE_DEFER)
> 
> but IS_ERR_VALUE is laready used for something else.
> 

note: i do not like hiding behind #defines

did you actually see code like IS_ERR_VALUE(data->clk, -EPROBE_DEFER)
in the current kernel ?
because there is no second argument:

#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)

or is this a misunderstanding ?

re,
 wh

> julia
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ