public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: is_err checking
Date: Sun, 24 Jul 2016 15:17:51 +0200	[thread overview]
Message-ID: <5794BFFF.7000408@bfs.de> (raw)
In-Reply-To: <alpine.DEB.2.10.1607231653440.3490@hadrien>



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@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2016-07-24 13:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-23 14:56 is_err checking Julia Lawall
2016-07-24 13:17 ` walter harms [this message]
2016-07-24 15:37   ` Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5794BFFF.7000408@bfs.de \
    --to=wharms@bfs.de \
    --cc=julia.lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox