trivial: Drop unlikely before IS_ERR(_OR_NULL)
Subsystems (25)
cover trivial: Drop unlikely before IS_ERR(_OR_NULL)
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(-)
Signature · 1 line
2.4.0
PATCH RESEND 1/10 err.h: add (missing) unlikely() to IS_ERR_OR_NULL()
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.
--- include/linux/err.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/err.h +1 -1
@@ -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); }/**
Signature · 1 line
2.4.0
Re: [PATCH V1 Resend 01/10] err.h: add (missing) unlikely() to IS_ERR_OR_NULL()
Hi Jiri,
Quoted 14 lines · Viresh Kumar
IS_ERR_VALUE()already contains it and so we need to add this only to the !ptr check. That will allow users ofIS_ERR_OR_NULL(), to not add this compiler flag.Signed-off-by Viresh Kumar <[email protected]>--- include/linux/err.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/err.h +0
-0
include/linux/err.h static inline bool __must_check IS_ERR(__force const void *ptr) · line 41
Quoted 6 lines
include/linux/err.h +1
-1@@ -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); }
Thanks for applying rest of the patches, but this is the most important one. Can you please apply this one as well ?
Signature · 1 line
viresh
PATCH RESEND 2/10 PM / OPP: Drop unlikely before IS_ERR(_OR_NULL)
In reply to Viresh KumarIS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there is no need to do that again from its callers. Drop it.
--- drivers/base/power/opp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/base/power/opp.c +3 -3
@@ -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;
Signature · 1 line
2.4.0
Re: [PATCH V1 Resend 02/10] PM / OPP: Drop unlikely before IS_ERR(_OR_NULL)
Quoted 5 lines · Viresh Kumar
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 <[email protected]>Signed-off-by Viresh Kumar <[email protected]>
Did that go anywhere or should I apply it?
Quoted 36 lines
--- drivers/base/power/opp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/base/power/opp.c +3
-3@@ -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;
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
Re: [PATCH V1 Resend 02/10] PM / OPP: Drop unlikely before IS_ERR(_OR_NULL)
Quoted 7 lines · Rafael J. Wysocki
Quoted 5 lines
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 <[email protected]>Signed-off-by Viresh Kumar <[email protected]>Did that go anywhere or should I apply it?
I didn't take it yet, so feel free to do so if you want.
With series like this, I usually wait a couple weeks and the pick the ones which haven't been picked into maintainer trees (I check that by looking for its presence in linux-next) through trivial.git afterwards.
Signature · 2 lines
Jiri Kosina SUSE Labs
Re: [PATCH V1 Resend 02/10] PM / OPP: Drop unlikely before IS_ERR(_OR_NULL)
Quoted 8 lines · Jiri Kosina
Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines
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 <[email protected]>Signed-off-by Viresh Kumar <[email protected]>
Quoted 7 lines
Quoted 1 line
Did that go anywhere or should I apply it?
I didn't take it yet, so feel free to do so if you want.
With series like this, I usually wait a couple weeks and the pick the ones which haven't been picked into maintainer trees (I check that by looking for its presence in linux-next) through trivial.git afterwards.
OK, I'll apply it then, thanks!
Rafael
Re: [PATCH V1 Resend 02/10] PM / OPP: Drop unlikely before IS_ERR(_OR_NULL)
In reply to Jiri KosinaQuoted 3 lines · Jiri Kosina
With series like this, I usually wait a couple weeks and the pick the ones which haven't been picked into maintainer trees (I check that by looking for its presence in linux-next) through trivial.git afterwards.
Is it the right to get the remaining patches applied now?
Signature · 1 line
viresh
PATCH RESEND 3/10 drivers: devfreq: Drop unlikely before IS_ERR(_OR_NULL)
In reply to Viresh KumarIS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there is no need to do that again from its callers. Drop it.
--- drivers/devfreq/devfreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/devfreq/devfreq.c +2 -2
@@ -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 ); }
Signature · 1 line
2.4.0
PATCH RESEND 4/10 drivers: misc: Drop unlikely before IS_ERR(_OR_NULL)
In reply to Viresh KumarIS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there is no need to do that again from its callers. Drop it.
--- drivers/misc/c2port/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/c2port/core.c +1 -1
@@ -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; }
Signature · 1 line
2.4.0
PATCH RESEND 5/10 drivers: net: Drop unlikely before IS_ERR(_OR_NULL)
In reply to Viresh KumarIS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there is no need to do that again from its callers. Drop it.
--- drivers/net/ethernet/ti/netcp_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/ti/netcp_core.c +2 -2
@@ -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;
Signature · 1 line
2.4.0
PATCH RESEND 6/10 drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)
In reply to Viresh KumarIS_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.
--- drivers/rtc/interface.c | 2 +- drivers/rtc/rtc-bfin.c | 2 +- drivers/rtc/rtc-gemini.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/rtc/interface.c +1 -1
@@ -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);
drivers/rtc/rtc-bfin.c +1 -1
@@ -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 */
drivers/rtc/rtc-gemini.c +1 -1
@@ -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 ;
Signature · 1 line
2.4.0
Re: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)
Hi Viresh,
Why are you resending?
Quoted 58 lines · Viresh Kumar
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 theunlikely()flags, lets kill that too.Signed-off-by Viresh Kumar <[email protected]>--- drivers/rtc/interface.c | 2 +- drivers/rtc/rtc-bfin.c | 2 +- drivers/rtc/rtc-gemini.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)drivers/rtc/interface.c +1
-1@@ -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);drivers/rtc/rtc-bfin.c +1
-1@@ -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 */ drivers/rtc/rtc-gemini.c +1
-1@@ -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 ;Signature · 1 line
2.4.0
Signature · 3 lines
Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
Re: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)
Quoted 3 lines · Alexandre Belloni
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.
Signature · 1 line
viresh
Re: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)
Quoted 10 lines · Viresh Kumar
Quoted 3 lines · Alexandre Belloni
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.
Quoted 9 lines
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.
Signature · 3 lines
Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
Re: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL)
Quoted 2 lines · Alexandre Belloni
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.
Signature · 1 line
viresh
PATCH RESEND 7/10 fs: Drop unlikely before IS_ERR(_OR_NULL)
In reply to Viresh KumarIS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there is no need to do that again from its callers. Drop it.
--- 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(-)
fs/cifs/readdir.c +1 -1
@@ -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) {
fs/ecryptfs/inode.c +1 -1
@@ -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);
fs/ext4/extents.c +3 -3
@@ -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;
fs/ext4/namei.c +1 -1
@@ -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;
fs/namei.c +2 -2
@@ -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);
fs/ncpfs/dir.c +1 -1
@@ -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);
fs/nfs/objlayout/objio_osd.c +1 -1
@@ -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) {
fs/proc/proc_sysctl.c +1 -1
@@ -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",
Signature · 6 lines
2.4.0 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH V1 Resend 07/10] fs: Drop unlikely before IS_ERR(_OR_NULL)
Quoted 139 lines · On Wed, 12 Aug 2015 15:59:44 +0530 Viresh Kumar <[email protected]> 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.Reviewed-by David Howells <[email protected]>Signed-off-by Viresh Kumar <[email protected]>--- 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(-)fs/cifs/readdir.c +1
-1@@ -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) {fs/ecryptfs/inode.c +1
-1@@ -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);fs/ext4/extents.c +3
-3@@ -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;fs/ext4/namei.c +1
-1@@ -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;fs/namei.c +2
-2@@ -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);fs/ncpfs/dir.c +1
-1@@ -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);fs/nfs/objlayout/objio_osd.c +1
-1@@ -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) {fs/proc/proc_sysctl.c +0
-0
fs/proc/proc_sysctl.c static struct ctl_dir *get_subdir(struct ctl_dir *dir, · line 954
Quoted 8 lines
fs/proc/proc_sysctl.c +1
-1@@ -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",
Looks fine to me. You can add:
...but the problem is that you have a patch here that touches several different filesystems. You'll have to find someone willing to take it into some overarching tree (Al's perhaps, or maybe Andrew's?), or break it up into several per-fs patches and shepherd it into different maintainers' trees.
Steve French
Reviewed-byRe: [PATCH V1 Resend 07/10] fs: Drop unlikely before IS_ERR(_OR_NULL)
Quoted 153 lines · Jeff Layton
Quoted 139 lines · On Wed, 12 Aug 2015 15:59:44 +0530 Viresh Kumar <[email protected]> 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.Reviewed-by David Howells <[email protected]>Signed-off-by Viresh Kumar <[email protected]>--- 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(-)fs/cifs/readdir.c +1
-1@@ -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) {fs/ecryptfs/inode.c +1
-1@@ -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);fs/ext4/extents.c +3
-3@@ -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;fs/ext4/namei.c +1
-1@@ -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;fs/namei.c +2
-2@@ -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);fs/ncpfs/dir.c +1
-1@@ -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);fs/nfs/objlayout/objio_osd.c +1
-1@@ -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) {fs/proc/proc_sysctl.c +0
-0fs/proc/proc_sysctl.c static struct ctl_dir *get_subdir(struct ctl_dir *dir, · line 954
Quoted 8 lines
fs/proc/proc_sysctl.c +1
-1@@ -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",Looks fine to me. You can add:
Quoted 7 lines
Reviewed-by Jeff Layton <[email protected]>...but the problem is that you have a patch here that touches several different filesystems. You'll have to find someone willing to take it into some overarching tree (Al's perhaps, or maybe Andrew's?), or break it up into several per-fs patches and shepherd it into different maintainers' trees.
Do you want me to merge the fs/cifs part of this independently (into cifs-2.6.git staging tree) or are you going to merge all of this (which changes multiple fs) at one time through someone else's tree?
Signature · 3 lines
Thanks, Steve
Re: [PATCH V1 Resend 07/10] fs: Drop unlikely before IS_ERR(_OR_NULL)
Quoted 5 lines · Steve French
Reviewed-by Steve French <[email protected]>Do you want me to merge the fs/cifs part of this independently (into cifs-2.6.git staging tree) or are you going to merge all of this (which changes multiple fs) at one time through someone else's tree?
The plan is to merge via Trivial tree, but the Maintainer isn't responding yet :)
Signature · 5 lines
viresh -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH RESEND 8/10 blk-cgroup: Drop unlikely before IS_ERR(_OR_NULL)
In reply to Viresh KumarIS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there is no need to do that again from its callers. Drop it.
--- include/linux/blk-cgroup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/blk-cgroup.h +1 -1
@@ -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);
Signature · 1 line
2.4.0
PATCH RESEND 9/10 mm: Drop unlikely before IS_ERR(_OR_NULL)
In reply to Viresh KumarIS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there is no need to do that again from its callers. Drop it.
--- mm/huge_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/huge_memory.c +1 -1
@@ -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 ;
Signature · 7 lines
2.4.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH RESEND 10/10 net: Drop unlikely before IS_ERR(_OR_NULL)
In reply to Viresh KumarIS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there is no need to do that again from its callers. Drop it.
--- net/openvswitch/datapath.c | 2 +- net/sctp/socket.c | 2 +- net/socket.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)
net/openvswitch/datapath.c +1 -1
@@ -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; }
net/sctp/socket.c +1 -1
@@ -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);
net/socket.c +3 -3
@@ -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);
Signature · 6 lines
2.4.0 _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
Quoted 8 lines · Viresh Kumar
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 !!
Signature · 1 line
viresh