public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] x86/irq: drop unlikely before IS_ERR_OR_NULL
@ 2015-10-01  2:55 Geliang Tang
  2015-10-01  2:55 ` [PATCH 2/3] Input: alps: " Geliang Tang
  2015-10-01  9:12 ` [tip:x86/apic] x86/irq: Drop " tip-bot for Geliang Tang
  0 siblings, 2 replies; 8+ messages in thread
From: Geliang Tang @ 2015-10-01  2:55 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Brian Gerst,
	Andy Lutomirski
  Cc: Geliang Tang, linux-kernel

IS_ERR_OR_NULL already contain an unlikely compiler flag. Drop it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 arch/x86/kernel/irq_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index c767cf2..206d0b9 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -72,7 +72,7 @@ bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
 {
 	stack_overflow_check(regs);
 
-	if (unlikely(IS_ERR_OR_NULL(desc)))
+	if (IS_ERR_OR_NULL(desc))
 		return false;
 
 	generic_handle_irq_desc(desc);
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] Input: alps: drop unlikely before IS_ERR_OR_NULL
  2015-10-01  2:55 [PATCH 1/3] x86/irq: drop unlikely before IS_ERR_OR_NULL Geliang Tang
@ 2015-10-01  2:55 ` Geliang Tang
  2015-10-01  2:55   ` [PATCH 3/3] cxlflash: " Geliang Tang
  2015-10-01  7:30   ` [PATCH 2/3] Input: alps: " Pali Rohár
  2015-10-01  9:12 ` [tip:x86/apic] x86/irq: Drop " tip-bot for Geliang Tang
  1 sibling, 2 replies; 8+ messages in thread
From: Geliang Tang @ 2015-10-01  2:55 UTC (permalink / raw)
  To: Dmitry Torokhov, Hans de Goede, Pali Rohár, Masaki Ota
  Cc: Geliang Tang, linux-input, linux-kernel

IS_ERR_OR_NULL already contain an unlikely compiler flag. Drop it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/input/mouse/alps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 4d24686..b4f146a 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -1367,7 +1367,7 @@ static void alps_report_bare_ps2_packet(struct psmouse *psmouse,
 		/* On V2 devices the DualPoint Stick reports bare packets */
 		dev = priv->dev2;
 		dev2 = psmouse->dev;
-	} else if (unlikely(IS_ERR_OR_NULL(priv->dev3))) {
+	} else if (IS_ERR_OR_NULL(priv->dev3)) {
 		/* Register dev3 mouse if we received PS/2 packet first time */
 		if (!IS_ERR(priv->dev3))
 			psmouse_queue_work(psmouse, &priv->dev3_register_work,
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] cxlflash: drop unlikely before IS_ERR_OR_NULL
  2015-10-01  2:55 ` [PATCH 2/3] Input: alps: " Geliang Tang
@ 2015-10-01  2:55   ` Geliang Tang
  2015-10-01 13:00     ` Manoj Kumar
  2015-10-01 14:49     ` Matthew R. Ochs
  2015-10-01  7:30   ` [PATCH 2/3] Input: alps: " Pali Rohár
  1 sibling, 2 replies; 8+ messages in thread
From: Geliang Tang @ 2015-10-01  2:55 UTC (permalink / raw)
  To: James E.J. Bottomley, Michael Neuling, Wen Xiong, Matthew R. Ochs,
	Manoj N. Kumar
  Cc: Geliang Tang, linux-scsi, linux-kernel

IS_ERR_OR_NULL already contain an unlikely compiler flag. Drop it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/scsi/cxlflash/superpipe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c
index f1b62ce..eb1b01e 100644
--- a/drivers/scsi/cxlflash/superpipe.c
+++ b/drivers/scsi/cxlflash/superpipe.c
@@ -1307,7 +1307,7 @@ static int cxlflash_disk_attach(struct scsi_device *sdev,
 	}
 
 	ctx = cxl_dev_context_init(cfg->dev);
-	if (unlikely(IS_ERR_OR_NULL(ctx))) {
+	if (IS_ERR_OR_NULL(ctx)) {
 		dev_err(dev, "%s: Could not initialize context %p\n",
 			__func__, ctx);
 		rc = -ENODEV;
@@ -1432,7 +1432,7 @@ static int recover_context(struct cxlflash_cfg *cfg, struct ctx_info *ctxi)
 	struct afu *afu = cfg->afu;
 
 	ctx = cxl_dev_context_init(cfg->dev);
-	if (unlikely(IS_ERR_OR_NULL(ctx))) {
+	if (IS_ERR_OR_NULL(ctx)) {
 		dev_err(dev, "%s: Could not initialize context %p\n",
 			__func__, ctx);
 		rc = -ENODEV;
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] Input: alps: drop unlikely before IS_ERR_OR_NULL
  2015-10-01  2:55 ` [PATCH 2/3] Input: alps: " Geliang Tang
  2015-10-01  2:55   ` [PATCH 3/3] cxlflash: " Geliang Tang
@ 2015-10-01  7:30   ` Pali Rohár
  2015-10-02 18:29     ` Dmitry Torokhov
  1 sibling, 1 reply; 8+ messages in thread
From: Pali Rohár @ 2015-10-01  7:30 UTC (permalink / raw)
  To: Geliang Tang
  Cc: Dmitry Torokhov, Hans de Goede, Masaki Ota, linux-input,
	linux-kernel

On Thursday 01 October 2015 10:55:30 Geliang Tang wrote:
> IS_ERR_OR_NULL already contain an unlikely compiler flag. Drop it.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  drivers/input/mouse/alps.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
> index 4d24686..b4f146a 100644
> --- a/drivers/input/mouse/alps.c
> +++ b/drivers/input/mouse/alps.c
> @@ -1367,7 +1367,7 @@ static void alps_report_bare_ps2_packet(struct psmouse *psmouse,
>  		/* On V2 devices the DualPoint Stick reports bare packets */
>  		dev = priv->dev2;
>  		dev2 = psmouse->dev;
> -	} else if (unlikely(IS_ERR_OR_NULL(priv->dev3))) {
> +	} else if (IS_ERR_OR_NULL(priv->dev3)) {
>  		/* Register dev3 mouse if we received PS/2 packet first time */
>  		if (!IS_ERR(priv->dev3))
>  			psmouse_queue_work(psmouse, &priv->dev3_register_work,

Hm... I do not like this change. If I read code

 if (unlikely(IS_ERR_OR_NULL(priv->dev3)))

then I know that it is really unlikely that condition will be truth and
so this is some case of error/exception or something that normally does
not happen too much.

But if I read code

 if (IS_ERR_OR_NULL(priv->dev3))

I know nothing about chance that this condition will be truth. Explicit
unlikely in previous example give me more information.

-- 
Pali Rohár
pali.rohar@gmail.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [tip:x86/apic] x86/irq: Drop unlikely before IS_ERR_OR_NULL
  2015-10-01  2:55 [PATCH 1/3] x86/irq: drop unlikely before IS_ERR_OR_NULL Geliang Tang
  2015-10-01  2:55 ` [PATCH 2/3] Input: alps: " Geliang Tang
@ 2015-10-01  9:12 ` tip-bot for Geliang Tang
  1 sibling, 0 replies; 8+ messages in thread
From: tip-bot for Geliang Tang @ 2015-10-01  9:12 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: brgerst, hpa, luto, tglx, mingo, linux-kernel, geliangtang

Commit-ID:  a7e705af524d165fe7bc303aee82225c66734885
Gitweb:     http://git.kernel.org/tip/a7e705af524d165fe7bc303aee82225c66734885
Author:     Geliang Tang <geliangtang@163.com>
AuthorDate: Thu, 1 Oct 2015 10:55:29 +0800
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 1 Oct 2015 11:08:56 +0200

x86/irq: Drop unlikely before IS_ERR_OR_NULL

IS_ERR_OR_NULL already contain an unlikely compiler flag. Drop it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>
Link: http://lkml.kernel.org/r/03d18502ed7ed417f136c091f417d2d88c147ec6.1443667610.git.geliangtang@163.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/irq_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index c767cf2..206d0b9 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -72,7 +72,7 @@ bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
 {
 	stack_overflow_check(regs);
 
-	if (unlikely(IS_ERR_OR_NULL(desc)))
+	if (IS_ERR_OR_NULL(desc))
 		return false;
 
 	generic_handle_irq_desc(desc);

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] cxlflash: drop unlikely before IS_ERR_OR_NULL
  2015-10-01  2:55   ` [PATCH 3/3] cxlflash: " Geliang Tang
@ 2015-10-01 13:00     ` Manoj Kumar
  2015-10-01 14:49     ` Matthew R. Ochs
  1 sibling, 0 replies; 8+ messages in thread
From: Manoj Kumar @ 2015-10-01 13:00 UTC (permalink / raw)
  To: Geliang Tang, James E.J. Bottomley, Michael Neuling, Wen Xiong,
	Matthew R. Ochs
  Cc: linux-scsi, linux-kernel

Geliang:

Thanks for catching this.

- Manoj

Acked-by: Manoj Kumar <manoj@linux.vnet.ibm.com>


On 9/30/2015 9:55 PM, Geliang Tang wrote:
> IS_ERR_OR_NULL already contain an unlikely compiler flag. Drop it.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>   drivers/scsi/cxlflash/superpipe.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c
> index f1b62ce..eb1b01e 100644
> --- a/drivers/scsi/cxlflash/superpipe.c
> +++ b/drivers/scsi/cxlflash/superpipe.c
> @@ -1307,7 +1307,7 @@ static int cxlflash_disk_attach(struct scsi_device *sdev,
>   	}
>
>   	ctx = cxl_dev_context_init(cfg->dev);
> -	if (unlikely(IS_ERR_OR_NULL(ctx))) {
> +	if (IS_ERR_OR_NULL(ctx)) {
>   		dev_err(dev, "%s: Could not initialize context %p\n",
>   			__func__, ctx);
>   		rc = -ENODEV;
> @@ -1432,7 +1432,7 @@ static int recover_context(struct cxlflash_cfg *cfg, struct ctx_info *ctxi)
>   	struct afu *afu = cfg->afu;
>
>   	ctx = cxl_dev_context_init(cfg->dev);
> -	if (unlikely(IS_ERR_OR_NULL(ctx))) {
> +	if (IS_ERR_OR_NULL(ctx)) {
>   		dev_err(dev, "%s: Could not initialize context %p\n",
>   			__func__, ctx);
>   		rc = -ENODEV;
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] cxlflash: drop unlikely before IS_ERR_OR_NULL
  2015-10-01  2:55   ` [PATCH 3/3] cxlflash: " Geliang Tang
  2015-10-01 13:00     ` Manoj Kumar
@ 2015-10-01 14:49     ` Matthew R. Ochs
  1 sibling, 0 replies; 8+ messages in thread
From: Matthew R. Ochs @ 2015-10-01 14:49 UTC (permalink / raw)
  To: Geliang Tang
  Cc: James E.J. Bottomley, Michael Neuling, Wen Xiong, Manoj N. Kumar,
	linux-scsi, linux-kernel

Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] Input: alps: drop unlikely before IS_ERR_OR_NULL
  2015-10-01  7:30   ` [PATCH 2/3] Input: alps: " Pali Rohár
@ 2015-10-02 18:29     ` Dmitry Torokhov
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Torokhov @ 2015-10-02 18:29 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Geliang Tang, Hans de Goede, Masaki Ota, linux-input,
	linux-kernel

On Thu, Oct 01, 2015 at 09:30:19AM +0200, Pali Rohár wrote:
> On Thursday 01 October 2015 10:55:30 Geliang Tang wrote:
> > IS_ERR_OR_NULL already contain an unlikely compiler flag. Drop it.
> > 
> > Signed-off-by: Geliang Tang <geliangtang@163.com>
> > ---
> >  drivers/input/mouse/alps.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
> > index 4d24686..b4f146a 100644
> > --- a/drivers/input/mouse/alps.c
> > +++ b/drivers/input/mouse/alps.c
> > @@ -1367,7 +1367,7 @@ static void alps_report_bare_ps2_packet(struct psmouse *psmouse,
> >  		/* On V2 devices the DualPoint Stick reports bare packets */
> >  		dev = priv->dev2;
> >  		dev2 = psmouse->dev;
> > -	} else if (unlikely(IS_ERR_OR_NULL(priv->dev3))) {
> > +	} else if (IS_ERR_OR_NULL(priv->dev3)) {
> >  		/* Register dev3 mouse if we received PS/2 packet first time */
> >  		if (!IS_ERR(priv->dev3))
> >  			psmouse_queue_work(psmouse, &priv->dev3_register_work,
> 
> Hm... I do not like this change. If I read code
> 
>  if (unlikely(IS_ERR_OR_NULL(priv->dev3)))
> 
> then I know that it is really unlikely that condition will be truth and
> so this is some case of error/exception or something that normally does
> not happen too much.
> 
> But if I read code
> 
>  if (IS_ERR_OR_NULL(priv->dev3))
> 
> I know nothing about chance that this condition will be truth. Explicit
> unlikely in previous example give me more information.

Yes, given that this is in packet processing path I prefer having
explicit unlikely there.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-10-02 18:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-01  2:55 [PATCH 1/3] x86/irq: drop unlikely before IS_ERR_OR_NULL Geliang Tang
2015-10-01  2:55 ` [PATCH 2/3] Input: alps: " Geliang Tang
2015-10-01  2:55   ` [PATCH 3/3] cxlflash: " Geliang Tang
2015-10-01 13:00     ` Manoj Kumar
2015-10-01 14:49     ` Matthew R. Ochs
2015-10-01  7:30   ` [PATCH 2/3] Input: alps: " Pali Rohár
2015-10-02 18:29     ` Dmitry Torokhov
2015-10-01  9:12 ` [tip:x86/apic] x86/irq: Drop " tip-bot for Geliang Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox