vial: Drop unlikely before IS_ERR(_OR_NULL)
Subsystems (27)
cover vial: Drop unlikely before IS_ERR(_OR_NULL)
Hi Andrew,
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.
V1->V2:
- Some of the patches are already applied
- Dropped input subsystem patch as Dmitry thought its more readable currently.
Viresh Kumar (11):
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: md: 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/md/dm-snap-persistent.c | 2 +- drivers/md/dm-verity.c | 2 +- drivers/md/persistent-data/dm-block-manager.c | 8 ++++---- 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 +++--- 24 files changed, 36 insertions(+), 36 deletions(-)
Signature · 1 line
2.4.0
PATCH RESEND 1/11 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
PATCH RESEND 2/11 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
@@ -134,7 +134,7 @@ static struct device_opp *_find_device_opp(struct device *dev) {struct device_opp *tmp_dev_opp, *dev_opp =ERR_PTR (-ENODEV ); -if (unlikely (IS_ERR_OR_NULL (dev))) { +if (IS_ERR_OR_NULL (dev)) {pr_err ("%s: Invalid parameters\n" , __func__);return ERR_PTR (-EINVAL ); }
@@ -172,7 +172,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;
@@ -204,7 +204,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/11] PM / OPP: Drop unlikely before IS_ERR(_OR_NULL)
Quoted 4 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.Signed-off-by Viresh Kumar <[email protected]>
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
PATCH RESEND 3/11 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/11 drivers: md: 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/md/dm-snap-persistent.c | 2 +- drivers/md/dm-verity.c | 2 +- drivers/md/persistent-data/dm-block-manager.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/md/dm-snap-persistent.c +1 -1
@@ -533,7 +533,7 @@ static int read_exceptions(struct pstore *ps, chunk =area_location (ps, ps->current_area); area =dm_bufio_read (client, chunk, &bp); -if (unlikely (IS_ERR (area))) { +if (IS_ERR (area)) { r =PTR_ERR (area); goto ret_destroy_bufio; }
drivers/md/dm-verity.c +1 -1
@@ -271,7 +271,7 @@ static int verity_verify_level(struct dm_verity_io *io, sector_t block,verity_hash_at_level (v, block, level, &hash_block, &offset); data =dm_bufio_read (v->bufio, hash_block, &buf); -if (unlikely (IS_ERR (data))) +if (IS_ERR (data))return PTR_ERR (data); aux =dm_bufio_get_aux_data (buf);
drivers/md/persistent-data/dm-block-manager.c +4 -4
@@ -454,7 +454,7 @@ int dm_bm_read_lock(struct dm_block_manager *bm, dm_block_t b,int r; p =dm_bufio_read (bm->bufio, b, (struct dm_buffer **) result); -if (unlikely (IS_ERR (p))) +if (IS_ERR (p))return PTR_ERR (p); aux =dm_bufio_get_aux_data (to_buffer (*result));
@@ -490,7 +490,7 @@ int dm_bm_write_lock(struct dm_block_manager *bm,return -EPERM ; p =dm_bufio_read (bm->bufio, b, (struct dm_buffer **) result); -if (unlikely (IS_ERR (p))) +if (IS_ERR (p))return PTR_ERR (p); aux =dm_bufio_get_aux_data (to_buffer (*result));
@@ -523,7 +523,7 @@ int dm_bm_read_try_lock(struct dm_block_manager *bm,int r; p =dm_bufio_get (bm->bufio, b, (struct dm_buffer **) result); -if (unlikely (IS_ERR (p))) +if (IS_ERR (p))return PTR_ERR (p);if (unlikely (!p))return -EWOULDBLOCK ;
@@ -559,7 +559,7 @@ int dm_bm_write_lock_zero(struct dm_block_manager *bm,return -EPERM ; p =dm_bufio_new (bm->bufio, b, (struct dm_buffer **) result); -if (unlikely (IS_ERR (p))) +if (IS_ERR (p))return PTR_ERR (p);memset (p,0 ,dm_bm_block_size (bm));
Signature · 1 line
2.4.0
Re: [PATCH V1 Resend 04/11] drivers: md: Drop unlikely before IS_ERR(_OR_NULL)
Quoted 4 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.Signed-off-by Viresh Kumar <[email protected]>
I picked this up for 4.3, staged in linux-dm.git's 'for-next', see:
https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=e2545d97b6cc0556fbd1099fca9271e3ca1d0b01
Thanks.
Re: [PATCH V1 Resend 04/11] drivers: md: Drop unlikely before IS_ERR(_OR_NULL)
Quoted 10 lines · Mike Snitzer
Quoted 4 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.Signed-off-by Viresh Kumar <[email protected]>I picked this up for 4.3, staged in linux-dm.git's 'for-next', see:
https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=e2545d97b6cc0556fbd1099fca9271e3ca1d0b01
I had no clue about it as I didn't look at individual maintainer's tree. But rebased things over linux-next/master.
Why isn't your branch merged into linux-next ?
Signature · 1 line
viresh
Re: [PATCH V1 Resend 04/11] drivers: md: Drop unlikely before IS_ERR(_OR_NULL)
Quoted 9 lines · Viresh Kumar
Quoted 8 lines · Mike Snitzer
Quoted 4 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.Signed-off-by Viresh Kumar <[email protected]>
Quoted 7 lines
Quoted 2 lines
I picked this up for 4.3, staged in linux-dm.git's 'for-next', see:
https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=e2545d97b6cc0556fbd1099fca9271e3ca1d0b01I had no clue about it as I didn't look at individual maintainer's tree. But rebased things over linux-next/master.
Why isn't your branch merged into linux-next ?
I just staged it today, so the next linux-next will pick it up.
PATCH RESEND 5/11 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 6/11 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
@@ -1027,7 +1027,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 ;
@@ -1060,7 +1060,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 7/11 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
PATCH RESEND 8/11 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 · 1 line
2.4.0
PATCH RESEND 9/11 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 10/11 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 11/11 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
Re: [PATCH V1 Resend 11/11] net: Drop unlikely before IS_ERR(_OR_NULL)