Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1205914 > unrolled thread

[PATCH V1 Resend 00/10] trivial: Drop unlikely before IS_ERR(_OR_NULL)

Started byViresh Kumar <viresh.kumar@linaro.org>
First post2015-08-12 12:30 +0200
Last post2015-08-18 11:10 +0200
Articles 16 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH V1 Resend 00/10] trivial: Drop unlikely before IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-12 12:30 +0200
    [PATCH V1 Resend 04/10] drivers: misc: Drop unlikely before IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-12 12:40 +0200
    [PATCH V1 Resend 08/10] blk-cgroup: Drop unlikely before IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-12 12:40 +0200
    [PATCH V1 Resend 01/10] err.h: add (missing) unlikely() to IS_ERR_OR_NULL() Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-12 12:40 +0200
    [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-12 12:40 +0200
      Re: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before  IS_ERR(_OR_NULL) Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-08-12 12:50 +0200
        Re: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before  IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-12 12:50 +0200
          Re: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before  IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-12 13:50 +0200
          Re: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before  IS_ERR(_OR_NULL) Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-08-12 13:50 +0200
    [PATCH V1 Resend 05/10] drivers: net: Drop unlikely before IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-12 12:40 +0200
    [PATCH V1 Resend 10/10] net: Drop unlikely before IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-12 12:40 +0200
    [PATCH V1 Resend 09/10] mm: Drop unlikely before IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-12 12:40 +0200
    [PATCH V1 Resend 02/10] PM / OPP: Drop unlikely before IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-12 12:40 +0200
    [PATCH V1 Resend 03/10] drivers: devfreq: Drop unlikely before IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-12 12:40 +0200
    [PATCH V1 Resend 07/10] fs: Drop unlikely before IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-12 12:40 +0200
    Re: [PATCH V1 Resend 00/10] trivial: Drop unlikely before  IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-18 11:10 +0200

#1205914 — [PATCH V1 Resend 00/10] trivial: Drop unlikely before IS_ERR(_OR_NULL)

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-12 12:30 +0200
Subject[PATCH V1 Resend 00/10] trivial: Drop unlikely before IS_ERR(_OR_NULL)
Message-ID<pWBsf-1Ag-47@gated-at.bofh.it>
Hi Jiri,

Andrew Morton suggested to take these patches through your tree and so
another resend.

This cleans up the usage of IS_ERR(_OR_NULL)(), where the callers have
added additional unlikely compiler flag to them. It also fixes the
definition of IS_ERR_OR_NULL(), to use unlikely for all checks it does.

Viresh Kumar (10):
  err.h: add (missing) unlikely() to IS_ERR_OR_NULL()
  PM / OPP: Drop unlikely before IS_ERR(_OR_NULL)
  drivers: devfreq: Drop unlikely before IS_ERR(_OR_NULL)
  drivers: misc: Drop unlikely before IS_ERR(_OR_NULL)
  drivers: net: Drop unlikely before IS_ERR(_OR_NULL)
  drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)
  fs: Drop unlikely before IS_ERR(_OR_NULL)
  blk-cgroup: Drop unlikely before IS_ERR(_OR_NULL)
  mm: Drop unlikely before IS_ERR(_OR_NULL)
  net: Drop unlikely before IS_ERR(_OR_NULL)

 drivers/base/power/opp.c             | 6 +++---
 drivers/devfreq/devfreq.c            | 4 ++--
 drivers/misc/c2port/core.c           | 2 +-
 drivers/net/ethernet/ti/netcp_core.c | 4 ++--
 drivers/rtc/interface.c              | 2 +-
 drivers/rtc/rtc-bfin.c               | 2 +-
 drivers/rtc/rtc-gemini.c             | 2 +-
 fs/cifs/readdir.c                    | 2 +-
 fs/ecryptfs/inode.c                  | 2 +-
 fs/ext4/extents.c                    | 6 +++---
 fs/ext4/namei.c                      | 2 +-
 fs/namei.c                           | 4 ++--
 fs/ncpfs/dir.c                       | 2 +-
 fs/nfs/objlayout/objio_osd.c         | 2 +-
 fs/proc/proc_sysctl.c                | 2 +-
 include/linux/blk-cgroup.h           | 2 +-
 include/linux/err.h                  | 2 +-
 mm/huge_memory.c                     | 2 +-
 net/openvswitch/datapath.c           | 2 +-
 net/sctp/socket.c                    | 2 +-
 net/socket.c                         | 6 +++---
 21 files changed, 30 insertions(+), 30 deletions(-)

-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1205917 — [PATCH V1 Resend 04/10] drivers: misc: Drop unlikely before IS_ERR(_OR_NULL)

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-12 12:40 +0200
Subject[PATCH V1 Resend 04/10] drivers: misc: Drop unlikely before IS_ERR(_OR_NULL)
Message-ID<pWBBT-1Ls-1@gated-at.bofh.it>
In reply to#1205914
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/misc/c2port/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/c2port/core.c b/drivers/misc/c2port/core.c
index 464419b36440..cc8645b5369d 100644
--- a/drivers/misc/c2port/core.c
+++ b/drivers/misc/c2port/core.c
@@ -926,7 +926,7 @@ struct c2port_device *c2port_device_register(char *name,
 
 	c2dev->dev = device_create(c2port_class, NULL, 0, c2dev,
 				   "c2port%d", c2dev->id);
-	if (unlikely(IS_ERR(c2dev->dev))) {
+	if (IS_ERR(c2dev->dev)) {
 		ret = PTR_ERR(c2dev->dev);
 		goto error_device_create;
 	}
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205918 — [PATCH V1 Resend 08/10] blk-cgroup: Drop unlikely before IS_ERR(_OR_NULL)

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-12 12:40 +0200
Subject[PATCH V1 Resend 08/10] blk-cgroup: Drop unlikely before IS_ERR(_OR_NULL)
Message-ID<pWBBT-1Ls-3@gated-at.bofh.it>
In reply to#1205914
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 include/linux/blk-cgroup.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index 1b62d768c7df..a4cd1641e9e2 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -374,7 +374,7 @@ static inline struct request_list *blk_get_rl(struct request_queue *q,
 	 * root_rl in such cases.
 	 */
 	blkg = blkg_lookup_create(blkcg, q);
-	if (unlikely(IS_ERR(blkg)))
+	if (IS_ERR(blkg))
 		goto root_rl;
 
 	blkg_get(blkg);
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205919 — [PATCH V1 Resend 01/10] err.h: add (missing) unlikely() to IS_ERR_OR_NULL()

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-12 12:40 +0200
Subject[PATCH V1 Resend 01/10] err.h: add (missing) unlikely() to IS_ERR_OR_NULL()
Message-ID<pWBBT-1Ls-7@gated-at.bofh.it>
In reply to#1205914
IS_ERR_VALUE() already contains it and so we need to add this only to
the !ptr check. That will allow users of IS_ERR_OR_NULL(), to not add
this compiler flag.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 include/linux/err.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/err.h b/include/linux/err.h
index a729120644d5..56762ab41713 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -37,7 +37,7 @@ static inline bool __must_check IS_ERR(__force const void *ptr)
 
 static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)
 {
-	return !ptr || IS_ERR_VALUE((unsigned long)ptr);
+	return unlikely(!ptr) || IS_ERR_VALUE((unsigned long)ptr);
 }
 
 /**
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205920 — [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-12 12:40 +0200
Subject[PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)
Message-ID<pWBBT-1Ls-9@gated-at.bofh.it>
In reply to#1205914
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

gemini driver was using likely() for a failure case while the rtc driver
is getting registered. That looks wrong and it should really be
unlikely. But because we are killing all the unlikely() flags, lets kill
that too.

Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com> (gemini)
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/rtc/interface.c  | 2 +-
 drivers/rtc/rtc-bfin.c   | 2 +-
 drivers/rtc/rtc-gemini.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 11b639067312..5836751b8203 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -564,7 +564,7 @@ enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer)
 void rtc_update_irq(struct rtc_device *rtc,
 		unsigned long num, unsigned long events)
 {
-	if (unlikely(IS_ERR_OR_NULL(rtc)))
+	if (IS_ERR_OR_NULL(rtc))
 		return;
 
 	pm_stay_awake(rtc->dev.parent);
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c
index 3d44b11721ea..535a5f9338d0 100644
--- a/drivers/rtc/rtc-bfin.c
+++ b/drivers/rtc/rtc-bfin.c
@@ -361,7 +361,7 @@ static int bfin_rtc_probe(struct platform_device *pdev)
 	/* Register our RTC with the RTC framework */
 	rtc->rtc_dev = devm_rtc_device_register(dev, pdev->name, &bfin_rtc_ops,
 						THIS_MODULE);
-	if (unlikely(IS_ERR(rtc->rtc_dev)))
+	if (IS_ERR(rtc->rtc_dev))
 		return PTR_ERR(rtc->rtc_dev);
 
 	/* Grab the IRQ and init the hardware */
diff --git a/drivers/rtc/rtc-gemini.c b/drivers/rtc/rtc-gemini.c
index 35f4486738fc..2fed93e1114a 100644
--- a/drivers/rtc/rtc-gemini.c
+++ b/drivers/rtc/rtc-gemini.c
@@ -148,7 +148,7 @@ static int gemini_rtc_probe(struct platform_device *pdev)
 
 	rtc->rtc_dev = rtc_device_register(pdev->name, dev,
 					   &gemini_rtc_ops, THIS_MODULE);
-	if (likely(IS_ERR(rtc->rtc_dev)))
+	if (IS_ERR(rtc->rtc_dev))
 		return PTR_ERR(rtc->rtc_dev);
 
 	return 0;
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205932 — Re: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2015-08-12 12:50 +0200
SubjectRe: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)
Message-ID<pWBLz-1Xg-1@gated-at.bofh.it>
In reply to#1205920
Hi Viresh,

Why are you resending?

On 12/08/2015 at 15:59:43 +0530, Viresh Kumar wrote :
> IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
> is no need to do that again from its callers. Drop it.
> 
> gemini driver was using likely() for a failure case while the rtc driver
> is getting registered. That looks wrong and it should really be
> unlikely. But because we are killing all the unlikely() flags, lets kill
> that too.
> 
> Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com> (gemini)
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/rtc/interface.c  | 2 +-
>  drivers/rtc/rtc-bfin.c   | 2 +-
>  drivers/rtc/rtc-gemini.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
> index 11b639067312..5836751b8203 100644
> --- a/drivers/rtc/interface.c
> +++ b/drivers/rtc/interface.c
> @@ -564,7 +564,7 @@ enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer)
>  void rtc_update_irq(struct rtc_device *rtc,
>  		unsigned long num, unsigned long events)
>  {
> -	if (unlikely(IS_ERR_OR_NULL(rtc)))
> +	if (IS_ERR_OR_NULL(rtc))
>  		return;
>  
>  	pm_stay_awake(rtc->dev.parent);
> diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c
> index 3d44b11721ea..535a5f9338d0 100644
> --- a/drivers/rtc/rtc-bfin.c
> +++ b/drivers/rtc/rtc-bfin.c
> @@ -361,7 +361,7 @@ static int bfin_rtc_probe(struct platform_device *pdev)
>  	/* Register our RTC with the RTC framework */
>  	rtc->rtc_dev = devm_rtc_device_register(dev, pdev->name, &bfin_rtc_ops,
>  						THIS_MODULE);
> -	if (unlikely(IS_ERR(rtc->rtc_dev)))
> +	if (IS_ERR(rtc->rtc_dev))
>  		return PTR_ERR(rtc->rtc_dev);
>  
>  	/* Grab the IRQ and init the hardware */
> diff --git a/drivers/rtc/rtc-gemini.c b/drivers/rtc/rtc-gemini.c
> index 35f4486738fc..2fed93e1114a 100644
> --- a/drivers/rtc/rtc-gemini.c
> +++ b/drivers/rtc/rtc-gemini.c
> @@ -148,7 +148,7 @@ static int gemini_rtc_probe(struct platform_device *pdev)
>  
>  	rtc->rtc_dev = rtc_device_register(pdev->name, dev,
>  					   &gemini_rtc_ops, THIS_MODULE);
> -	if (likely(IS_ERR(rtc->rtc_dev)))
> +	if (IS_ERR(rtc->rtc_dev))
>  		return PTR_ERR(rtc->rtc_dev);
>  
>  	return 0;
> -- 
> 2.4.0
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205951 — Re: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-12 12:50 +0200
SubjectRe: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)
Message-ID<pWBLB-1Xg-37@gated-at.bofh.it>
In reply to#1205932
On 12-08-15, 12:41, Alexandre Belloni wrote:
> Hi Viresh,
> 
> Why are you resending?

I never got a reply from Andrew Morton on V1, so resent it again. And
today Andrew asked me to take this via trivial tree.

So the resent.

I need to find a sane way to get few more people to the cover-letter.
The problem is that I am generating the cc-list with get_maintainers,
and if I combine that list for all the patches, it becomes huge. And
really can't send the cover-letter to those people then. Few lists may
block it as well, due to high number of cc'd people.

I am telling this because, the cover-letter did contain the reason for
resend.

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205979 — Re: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-12 13:50 +0200
SubjectRe: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)
Message-ID<pWCHE-3ic-1@gated-at.bofh.it>
In reply to#1205951
On 12-08-15, 13:42, Alexandre Belloni wrote:
> The fact is that I sent you a mail yesterday stating that I applied that
> particular patch.

Urg ..

I looked at the 'V1 Resend' series to see which all are applied, and
missed your reply on the first version.

Sorry about that.

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205982 — Re: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2015-08-12 13:50 +0200
SubjectRe: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)
Message-ID<pWCHE-3ic-3@gated-at.bofh.it>
In reply to#1205951
On 12/08/2015 at 16:16:25 +0530, Viresh Kumar wrote :
> On 12-08-15, 12:41, Alexandre Belloni wrote:
> > Hi Viresh,
> > 
> > Why are you resending?
> 
> I never got a reply from Andrew Morton on V1, so resent it again. And
> today Andrew asked me to take this via trivial tree.
> 
> So the resent.
> 
> I need to find a sane way to get few more people to the cover-letter.
> The problem is that I am generating the cc-list with get_maintainers,
> and if I combine that list for all the patches, it becomes huge. And
> really can't send the cover-letter to those people then. Few lists may
> block it as well, due to high number of cc'd people.
> 
> I am telling this because, the cover-letter did contain the reason for
> resend.
> 

The fact is that I sent you a mail yesterday stating that I applied that
particular patch.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205922 — [PATCH V1 Resend 05/10] drivers: net: Drop unlikely before IS_ERR(_OR_NULL)

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-12 12:40 +0200
Subject[PATCH V1 Resend 05/10] drivers: net: Drop unlikely before IS_ERR(_OR_NULL)
Message-ID<pWBBT-1Ls-21@gated-at.bofh.it>
In reply to#1205914
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

Acked-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/net/ethernet/ti/netcp_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
index 1a5aca55ea9f..f7f6e442e94b 100644
--- a/drivers/net/ethernet/ti/netcp_core.c
+++ b/drivers/net/ethernet/ti/netcp_core.c
@@ -1026,7 +1026,7 @@ netcp_tx_map_skb(struct sk_buff *skb, struct netcp_intf *netcp)
 	}
 
 	desc = knav_pool_desc_get(netcp->tx_pool);
-	if (unlikely(IS_ERR_OR_NULL(desc))) {
+	if (IS_ERR_OR_NULL(desc)) {
 		dev_err(netcp->ndev_dev, "out of TX desc\n");
 		dma_unmap_single(dev, dma_addr, pkt_len, DMA_TO_DEVICE);
 		return NULL;
@@ -1059,7 +1059,7 @@ netcp_tx_map_skb(struct sk_buff *skb, struct netcp_intf *netcp)
 		}
 
 		ndesc = knav_pool_desc_get(netcp->tx_pool);
-		if (unlikely(IS_ERR_OR_NULL(ndesc))) {
+		if (IS_ERR_OR_NULL(ndesc)) {
 			dev_err(netcp->ndev_dev, "out of TX desc for frags\n");
 			dma_unmap_page(dev, dma_addr, buf_len, DMA_TO_DEVICE);
 			goto free_descs;
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205926 — [PATCH V1 Resend 10/10] net: Drop unlikely before IS_ERR(_OR_NULL)

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-12 12:40 +0200
Subject[PATCH V1 Resend 10/10] net: Drop unlikely before IS_ERR(_OR_NULL)
Message-ID<pWBBU-1Ls-33@gated-at.bofh.it>
In reply to#1205914
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 net/openvswitch/datapath.c | 2 +-
 net/sctp/socket.c          | 2 +-
 net/socket.c               | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index ffe984f5b95c..a515e338cade 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -1143,7 +1143,7 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)
 						info, OVS_FLOW_CMD_NEW, false,
 						ufid_flags);
 
-		if (unlikely(IS_ERR(reply))) {
+		if (IS_ERR(reply)) {
 			error = PTR_ERR(reply);
 			goto err_unlock_ovs;
 		}
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 17bef01b9aa3..897c01c029ca 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4475,7 +4475,7 @@ static int sctp_getsockopt_peeloff(struct sock *sk, int len, char __user *optval
 	}
 
 	newfile = sock_alloc_file(newsock, 0, NULL);
-	if (unlikely(IS_ERR(newfile))) {
+	if (IS_ERR(newfile)) {
 		put_unused_fd(retval);
 		sock_release(newsock);
 		return PTR_ERR(newfile);
diff --git a/net/socket.c b/net/socket.c
index 9963a0b53a64..dd2c247c99e3 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -373,7 +373,7 @@ struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname)
 
 	file = alloc_file(&path, FMODE_READ | FMODE_WRITE,
 		  &socket_file_ops);
-	if (unlikely(IS_ERR(file))) {
+	if (IS_ERR(file)) {
 		/* drop dentry, keep inode */
 		ihold(d_inode(path.dentry));
 		path_put(&path);
@@ -1303,7 +1303,7 @@ SYSCALL_DEFINE4(socketpair, int, family, int, type, int, protocol,
 	}
 
 	newfile1 = sock_alloc_file(sock1, flags, NULL);
-	if (unlikely(IS_ERR(newfile1))) {
+	if (IS_ERR(newfile1)) {
 		err = PTR_ERR(newfile1);
 		goto out_put_unused_both;
 	}
@@ -1467,7 +1467,7 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
 		goto out_put;
 	}
 	newfile = sock_alloc_file(newsock, flags, sock->sk->sk_prot_creator->name);
-	if (unlikely(IS_ERR(newfile))) {
+	if (IS_ERR(newfile)) {
 		err = PTR_ERR(newfile);
 		put_unused_fd(newfd);
 		sock_release(newsock);
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205927 — [PATCH V1 Resend 09/10] mm: Drop unlikely before IS_ERR(_OR_NULL)

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-12 12:40 +0200
Subject[PATCH V1 Resend 09/10] mm: Drop unlikely before IS_ERR(_OR_NULL)
Message-ID<pWBBU-1Ls-39@gated-at.bofh.it>
In reply to#1205914
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 mm/huge_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 7109330c5911..97b8d5cd4550 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -151,7 +151,7 @@ static int start_stop_khugepaged(void)
 		if (!khugepaged_thread)
 			khugepaged_thread = kthread_run(khugepaged, NULL,
 							"khugepaged");
-		if (unlikely(IS_ERR(khugepaged_thread))) {
+		if (IS_ERR(khugepaged_thread)) {
 			pr_err("khugepaged: kthread_run(khugepaged) failed\n");
 			err = PTR_ERR(khugepaged_thread);
 			khugepaged_thread = NULL;
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205928 — [PATCH V1 Resend 02/10] PM / OPP: Drop unlikely before IS_ERR(_OR_NULL)

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-12 12:40 +0200
Subject[PATCH V1 Resend 02/10] PM / OPP: Drop unlikely before IS_ERR(_OR_NULL)
Message-ID<pWBBU-1Ls-41@gated-at.bofh.it>
In reply to#1205914
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/base/power/opp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 51b220e615d3..97c31170437d 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -204,7 +204,7 @@ static struct device_opp *_find_device_opp(struct device *dev)
 {
 	struct device_opp *dev_opp;
 
-	if (unlikely(IS_ERR_OR_NULL(dev))) {
+	if (IS_ERR_OR_NULL(dev)) {
 		pr_err("%s: Invalid parameters\n", __func__);
 		return ERR_PTR(-EINVAL);
 	}
@@ -239,7 +239,7 @@ unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp)
 	opp_rcu_lockdep_assert();
 
 	tmp_opp = rcu_dereference(opp);
-	if (unlikely(IS_ERR_OR_NULL(tmp_opp)) || !tmp_opp->available)
+	if (IS_ERR_OR_NULL(tmp_opp) || !tmp_opp->available)
 		pr_err("%s: Invalid parameters\n", __func__);
 	else
 		v = tmp_opp->u_volt;
@@ -271,7 +271,7 @@ unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)
 	opp_rcu_lockdep_assert();
 
 	tmp_opp = rcu_dereference(opp);
-	if (unlikely(IS_ERR_OR_NULL(tmp_opp)) || !tmp_opp->available)
+	if (IS_ERR_OR_NULL(tmp_opp) || !tmp_opp->available)
 		pr_err("%s: Invalid parameters\n", __func__);
 	else
 		f = tmp_opp->rate;
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205929 — [PATCH V1 Resend 03/10] drivers: devfreq: Drop unlikely before IS_ERR(_OR_NULL)

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-12 12:40 +0200
Subject[PATCH V1 Resend 03/10] drivers: devfreq: Drop unlikely before IS_ERR(_OR_NULL)
Message-ID<pWBBU-1Ls-35@gated-at.bofh.it>
In reply to#1205914
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/devfreq/devfreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index ca1b362d77e2..f28a1fae5691 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -53,7 +53,7 @@ static struct devfreq *find_device_devfreq(struct device *dev)
 {
 	struct devfreq *tmp_devfreq;
 
-	if (unlikely(IS_ERR_OR_NULL(dev))) {
+	if (IS_ERR_OR_NULL(dev)) {
 		pr_err("DEVFREQ: %s: Invalid parameters\n", __func__);
 		return ERR_PTR(-EINVAL);
 	}
@@ -133,7 +133,7 @@ static struct devfreq_governor *find_devfreq_governor(const char *name)
 {
 	struct devfreq_governor *tmp_governor;
 
-	if (unlikely(IS_ERR_OR_NULL(name))) {
+	if (IS_ERR_OR_NULL(name)) {
 		pr_err("DEVFREQ: %s: Invalid parameters\n", __func__);
 		return ERR_PTR(-EINVAL);
 	}
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205930 — [PATCH V1 Resend 07/10] fs: Drop unlikely before IS_ERR(_OR_NULL)

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-12 12:40 +0200
Subject[PATCH V1 Resend 07/10] fs: Drop unlikely before IS_ERR(_OR_NULL)
Message-ID<pWBBU-1Ls-37@gated-at.bofh.it>
In reply to#1205914
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 fs/cifs/readdir.c            | 2 +-
 fs/ecryptfs/inode.c          | 2 +-
 fs/ext4/extents.c            | 6 +++---
 fs/ext4/namei.c              | 2 +-
 fs/namei.c                   | 4 ++--
 fs/ncpfs/dir.c               | 2 +-
 fs/nfs/objlayout/objio_osd.c | 2 +-
 fs/proc/proc_sysctl.c        | 2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index b1eede3678a9..0557c45e9c33 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -84,7 +84,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
 	cifs_dbg(FYI, "%s: for %s\n", __func__, name->name);
 
 	dentry = d_hash_and_lookup(parent, name);
-	if (unlikely(IS_ERR(dentry)))
+	if (IS_ERR(dentry))
 		return;
 
 	if (dentry) {
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 3c4db1172d22..e2e47ba5d313 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -270,7 +270,7 @@ ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry,
 
 	ecryptfs_inode = ecryptfs_do_create(directory_inode, ecryptfs_dentry,
 					    mode);
-	if (unlikely(IS_ERR(ecryptfs_inode))) {
+	if (IS_ERR(ecryptfs_inode)) {
 		ecryptfs_printk(KERN_WARNING, "Failed to create file in"
 				"lower filesystem\n");
 		rc = PTR_ERR(ecryptfs_inode);
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 2553aa8b608d..799f01714767 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -899,7 +899,7 @@ ext4_find_extent(struct inode *inode, ext4_lblk_t block,
 
 		bh = read_extent_tree_block(inode, path[ppos].p_block, --i,
 					    flags);
-		if (unlikely(IS_ERR(bh))) {
+		if (IS_ERR(bh)) {
 			ret = PTR_ERR(bh);
 			goto err;
 		}
@@ -5792,7 +5792,7 @@ ext4_swap_extents(handle_t *handle, struct inode *inode1,
 		int split = 0;
 
 		path1 = ext4_find_extent(inode1, lblk1, NULL, EXT4_EX_NOCACHE);
-		if (unlikely(IS_ERR(path1))) {
+		if (IS_ERR(path1)) {
 			*erp = PTR_ERR(path1);
 			path1 = NULL;
 		finish:
@@ -5800,7 +5800,7 @@ ext4_swap_extents(handle_t *handle, struct inode *inode1,
 			goto repeat;
 		}
 		path2 = ext4_find_extent(inode2, lblk2, NULL, EXT4_EX_NOCACHE);
-		if (unlikely(IS_ERR(path2))) {
+		if (IS_ERR(path2)) {
 			*erp = PTR_ERR(path2);
 			path2 = NULL;
 			goto finish;
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 9f61e7679a6d..f12b277ad2af 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1429,7 +1429,7 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
 				}
 				num++;
 				bh = ext4_getblk(NULL, dir, b++, 0);
-				if (unlikely(IS_ERR(bh))) {
+				if (IS_ERR(bh)) {
 					if (ra_max == 0) {
 						ret = bh;
 						goto cleanup_and_exit;
diff --git a/fs/namei.c b/fs/namei.c
index cacc51ddcf54..67d419e55547 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1942,7 +1942,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
 		if (err) {
 			const char *s = get_link(nd);
 
-			if (unlikely(IS_ERR(s)))
+			if (IS_ERR(s))
 				return PTR_ERR(s);
 			err = 0;
 			if (unlikely(!s)) {
@@ -3430,7 +3430,7 @@ struct file *do_file_open_root(struct dentry *dentry, struct vfsmount *mnt,
 		return ERR_PTR(-ELOOP);
 
 	filename = getname_kernel(name);
-	if (unlikely(IS_ERR(filename)))
+	if (IS_ERR(filename))
 		return ERR_CAST(filename);
 
 	set_nameidata(&nd, -1, filename);
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
index 93575e91a7aa..356816e7bc90 100644
--- a/fs/ncpfs/dir.c
+++ b/fs/ncpfs/dir.c
@@ -597,7 +597,7 @@ ncp_fill_cache(struct file *file, struct dir_context *ctx,
 	qname.name = __name;
 
 	newdent = d_hash_and_lookup(dentry, &qname);
-	if (unlikely(IS_ERR(newdent)))
+	if (IS_ERR(newdent))
 		goto end_advance;
 	if (!newdent) {
 		newdent = d_alloc(dentry, &qname);
diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
index 5aaed363556a..5c0c6b58157f 100644
--- a/fs/nfs/objlayout/objio_osd.c
+++ b/fs/nfs/objlayout/objio_osd.c
@@ -124,7 +124,7 @@ objio_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
 
 retry_lookup:
 	od = osduld_info_lookup(&odi);
-	if (unlikely(IS_ERR(od))) {
+	if (IS_ERR(od)) {
 		err = PTR_ERR(od);
 		dprintk("%s: osduld_info_lookup => %d\n", __func__, err);
 		if (err == -ENODEV && retry_flag) {
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index fdda62e6115e..fe5b6e6c4671 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -948,7 +948,7 @@ static struct ctl_dir *get_subdir(struct ctl_dir *dir,
 found:
 	subdir->header.nreg++;
 failed:
-	if (unlikely(IS_ERR(subdir))) {
+	if (IS_ERR(subdir)) {
 		pr_err("sysctl could not get directory: ");
 		sysctl_print_dir(dir);
 		pr_cont("/%*.*s %ld\n",
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1209144 — Re: [PATCH V1 Resend 00/10] trivial: Drop unlikely before IS_ERR(_OR_NULL)

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-08-18 11:10 +0200
SubjectRe: [PATCH V1 Resend 00/10] trivial: Drop unlikely before IS_ERR(_OR_NULL)
Message-ID<pYL46-1EV-9@gated-at.bofh.it>
In reply to#1205914
On 12-08-15, 15:59, Viresh Kumar wrote:
> Hi Jiri,
> 
> Andrew Morton suggested to take these patches through your tree and so
> another resend.
> 
> This cleans up the usage of IS_ERR(_OR_NULL)(), where the callers have
> added additional unlikely compiler flag to them. It also fixes the
> definition of IS_ERR_OR_NULL(), to use unlikely for all checks it does.

Ping !!

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web