All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org
Subject: Re: IS_ERR_VALUE()
Date: Tue, 12 Mar 2013 09:34:22 -0700	[thread overview]
Message-ID: <20130312163422.GY26093@atomide.com> (raw)
In-Reply-To: <20130312141604.GV4977@n2100.arm.linux.org.uk>

* Russell King - ARM Linux <linux@arm.linux.org.uk> [130312 07:25]:
> I am removing almost all references to the above macro from arch/arm.
> Many of them are wrong.  Some of them are buggy.
> 
> For instance:
> 
> int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
> {
>         int div;
>         div = gpmc_calc_divider(t->sync_clk);
>         if (div < 0)
>                 return div;
> static int gpmc_set_async_mode(int cs, struct gpmc_timings *t)
> {
> ...
>         return gpmc_cs_set_timings(cs, t);
> 
> .....
>         ret = gpmc_set_async_mode(gpmc_onenand_data->cs, &t);
>         if (IS_ERR_VALUE(ret))
>                 return ret;
> 
> So, gpmc_cs_set_timings() thinks any negative return value is an error,
> but where we check that in higher levels, only a limited range are
> errors... seriously?  Come on guys, get with the program.  Get your
> error checking in order.
> 
> There is only _one_ use of IS_ERR_VALUE() in arch/arm which is correct,
> and that is in arch/arm/include/asm/syscall.h:
> 
> static inline long syscall_get_error(struct task_struct *task,
>                                      struct pt_regs *regs)
> {
>         unsigned long error = regs->ARM_r0;
>         return IS_ERR_VALUE(error) ? error : 0;
> }
> 
> So, here's a patch to remove them all, except for the above.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> This patch will be going into my "cleanup" branch along with the removal
> of many wrong IS_ERR_OR_NULL() uses - with any errors anyone spots fixed.

Looks good to me. Can you please also let us know some immutable
commit for your cleanup branch? I'd like to use that as a base
to pull in further GPMC changes to avoid unnecessary merge conflicts.

Acked-by: Tony Lindgren <tony@atomide.com>

WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: IS_ERR_VALUE()
Date: Tue, 12 Mar 2013 09:34:22 -0700	[thread overview]
Message-ID: <20130312163422.GY26093@atomide.com> (raw)
In-Reply-To: <20130312141604.GV4977@n2100.arm.linux.org.uk>

* Russell King - ARM Linux <linux@arm.linux.org.uk> [130312 07:25]:
> I am removing almost all references to the above macro from arch/arm.
> Many of them are wrong.  Some of them are buggy.
> 
> For instance:
> 
> int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
> {
>         int div;
>         div = gpmc_calc_divider(t->sync_clk);
>         if (div < 0)
>                 return div;
> static int gpmc_set_async_mode(int cs, struct gpmc_timings *t)
> {
> ...
>         return gpmc_cs_set_timings(cs, t);
> 
> .....
>         ret = gpmc_set_async_mode(gpmc_onenand_data->cs, &t);
>         if (IS_ERR_VALUE(ret))
>                 return ret;
> 
> So, gpmc_cs_set_timings() thinks any negative return value is an error,
> but where we check that in higher levels, only a limited range are
> errors... seriously?  Come on guys, get with the program.  Get your
> error checking in order.
> 
> There is only _one_ use of IS_ERR_VALUE() in arch/arm which is correct,
> and that is in arch/arm/include/asm/syscall.h:
> 
> static inline long syscall_get_error(struct task_struct *task,
>                                      struct pt_regs *regs)
> {
>         unsigned long error = regs->ARM_r0;
>         return IS_ERR_VALUE(error) ? error : 0;
> }
> 
> So, here's a patch to remove them all, except for the above.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> This patch will be going into my "cleanup" branch along with the removal
> of many wrong IS_ERR_OR_NULL() uses - with any errors anyone spots fixed.

Looks good to me. Can you please also let us know some immutable
commit for your cleanup branch? I'd like to use that as a base
to pull in further GPMC changes to avoid unnecessary merge conflicts.

Acked-by: Tony Lindgren <tony@atomide.com>

  reply	other threads:[~2013-03-12 16:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12 14:16 IS_ERR_VALUE() Russell King - ARM Linux
2013-03-12 14:16 ` IS_ERR_VALUE() Russell King - ARM Linux
2013-03-12 16:34 ` Tony Lindgren [this message]
2013-03-12 16:34   ` IS_ERR_VALUE() Tony Lindgren
2013-03-12 19:56 ` IS_ERR_VALUE() Uwe Kleine-König
2013-03-12 19:56   ` IS_ERR_VALUE() Uwe Kleine-König
2013-03-12 20:22   ` IS_ERR_VALUE() Russell King - ARM Linux
2013-03-12 20:22     ` IS_ERR_VALUE() Russell King - ARM Linux
2013-03-12 21:18     ` IS_ERR_VALUE() Uwe Kleine-König
2013-03-12 21:18       ` IS_ERR_VALUE() Uwe Kleine-König

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=20130312163422.GY26093@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.