Commit 801678c5a3b4c79236970bcca27c733f5559e0d1
Committed by
Linus Torvalds
1 parent
9a6f70bbed
Exists in
master
and in
4 other branches
Remove duplicated unlikely() in IS_ERR()
Some drivers have duplicated unlikely() macros. IS_ERR() already has unlikely() in itself. This patch cleans up such pointless code. Signed-off-by: Hirofumi Nakagawa <hnakagawa@miraclelinux.com> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Jeff Garzik <jeff@garzik.org> Cc: Paul Clements <paul.clements@steeleye.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Michael Halcrow <mhalcrow@us.ibm.com> Cc: Anton Altaparmakov <aia21@cantab.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Carsten Otte <cotte@de.ibm.com> Cc: Patrick McHardy <kaber@trash.net> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.de> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 17 changed files with 23 additions and 23 deletions Side-by-side Diff
- drivers/block/nbd.c
- drivers/leds/led-class.c
- drivers/message/i2o/i2o_block.c
- drivers/net/myri10ge/myri10ge.c
- drivers/net/tg3.c
- drivers/rtc/rtc-bfin.c
- drivers/scsi/scsi_scan.c
- fs/aio.c
- fs/ecryptfs/inode.c
- fs/inotify_user.c
- fs/ntfs/mft.c
- kernel/auditfilter.c
- net/core/dev.c
- net/ipv4/af_inet.c
- net/netfilter/nf_queue.c
- net/xfrm/xfrm_output.c
- sound/sh/aica.c
drivers/block/nbd.c
drivers/leds/led-class.c
... | ... | @@ -105,7 +105,7 @@ |
105 | 105 | |
106 | 106 | led_cdev->dev = device_create(leds_class, parent, 0, "%s", |
107 | 107 | led_cdev->name); |
108 | - if (unlikely(IS_ERR(led_cdev->dev))) | |
108 | + if (IS_ERR(led_cdev->dev)) | |
109 | 109 | return PTR_ERR(led_cdev->dev); |
110 | 110 | |
111 | 111 | dev_set_drvdata(led_cdev->dev, led_cdev); |
drivers/message/i2o/i2o_block.c
... | ... | @@ -371,7 +371,7 @@ |
371 | 371 | /* connect the i2o_block_request to the request */ |
372 | 372 | if (!req->special) { |
373 | 373 | ireq = i2o_block_request_alloc(); |
374 | - if (unlikely(IS_ERR(ireq))) { | |
374 | + if (IS_ERR(ireq)) { | |
375 | 375 | osm_debug("unable to allocate i2o_block_request!\n"); |
376 | 376 | return BLKPREP_DEFER; |
377 | 377 | } |
drivers/net/myri10ge/myri10ge.c
drivers/net/tg3.c
drivers/rtc/rtc-bfin.c
drivers/scsi/scsi_scan.c
fs/aio.c
... | ... | @@ -1604,7 +1604,7 @@ |
1604 | 1604 | * event using the eventfd_signal() function. |
1605 | 1605 | */ |
1606 | 1606 | req->ki_eventfd = eventfd_fget((int) iocb->aio_resfd); |
1607 | - if (unlikely(IS_ERR(req->ki_eventfd))) { | |
1607 | + if (IS_ERR(req->ki_eventfd)) { | |
1608 | 1608 | ret = PTR_ERR(req->ki_eventfd); |
1609 | 1609 | goto out_put_req; |
1610 | 1610 | } |
fs/ecryptfs/inode.c
... | ... | @@ -111,7 +111,7 @@ |
111 | 111 | |
112 | 112 | lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry); |
113 | 113 | lower_dir_dentry = lock_parent(lower_dentry); |
114 | - if (unlikely(IS_ERR(lower_dir_dentry))) { | |
114 | + if (IS_ERR(lower_dir_dentry)) { | |
115 | 115 | ecryptfs_printk(KERN_ERR, "Error locking directory of " |
116 | 116 | "dentry\n"); |
117 | 117 | rc = PTR_ERR(lower_dir_dentry); |
fs/inotify_user.c
fs/ntfs/mft.c
... | ... | @@ -1191,7 +1191,7 @@ |
1191 | 1191 | if (size) { |
1192 | 1192 | page = ntfs_map_page(mftbmp_mapping, |
1193 | 1193 | ofs >> PAGE_CACHE_SHIFT); |
1194 | - if (unlikely(IS_ERR(page))) { | |
1194 | + if (IS_ERR(page)) { | |
1195 | 1195 | ntfs_error(vol->sb, "Failed to read mft " |
1196 | 1196 | "bitmap, aborting."); |
1197 | 1197 | return PTR_ERR(page); |
... | ... | @@ -2118,7 +2118,7 @@ |
2118 | 2118 | } |
2119 | 2119 | /* Read, map, and pin the page containing the mft record. */ |
2120 | 2120 | page = ntfs_map_page(mft_vi->i_mapping, index); |
2121 | - if (unlikely(IS_ERR(page))) { | |
2121 | + if (IS_ERR(page)) { | |
2122 | 2122 | ntfs_error(vol->sb, "Failed to map page containing mft record " |
2123 | 2123 | "to format 0x%llx.", (long long)mft_no); |
2124 | 2124 | return PTR_ERR(page); |
... | ... | @@ -2519,7 +2519,7 @@ |
2519 | 2519 | ofs = (bit << vol->mft_record_size_bits) & ~PAGE_CACHE_MASK; |
2520 | 2520 | /* Read, map, and pin the page containing the mft record. */ |
2521 | 2521 | page = ntfs_map_page(vol->mft_ino->i_mapping, index); |
2522 | - if (unlikely(IS_ERR(page))) { | |
2522 | + if (IS_ERR(page)) { | |
2523 | 2523 | ntfs_error(vol->sb, "Failed to map page containing allocated " |
2524 | 2524 | "mft record 0x%llx.", (long long)bit); |
2525 | 2525 | err = PTR_ERR(page); |
kernel/auditfilter.c
... | ... | @@ -272,7 +272,7 @@ |
272 | 272 | return -EINVAL; |
273 | 273 | |
274 | 274 | watch = audit_init_watch(path); |
275 | - if (unlikely(IS_ERR(watch))) | |
275 | + if (IS_ERR(watch)) | |
276 | 276 | return PTR_ERR(watch); |
277 | 277 | |
278 | 278 | audit_get_watch(watch); |
... | ... | @@ -848,7 +848,7 @@ |
848 | 848 | return ERR_PTR(-ENOMEM); |
849 | 849 | |
850 | 850 | new = audit_init_watch(path); |
851 | - if (unlikely(IS_ERR(new))) { | |
851 | + if (IS_ERR(new)) { | |
852 | 852 | kfree(path); |
853 | 853 | goto out; |
854 | 854 | } |
... | ... | @@ -989,7 +989,7 @@ |
989 | 989 | audit_set_auditable(current->audit_context); |
990 | 990 | |
991 | 991 | nwatch = audit_dupe_watch(owatch); |
992 | - if (unlikely(IS_ERR(nwatch))) { | |
992 | + if (IS_ERR(nwatch)) { | |
993 | 993 | mutex_unlock(&audit_filter_mutex); |
994 | 994 | audit_panic("error updating watch, skipping"); |
995 | 995 | return; |
... | ... | @@ -1004,7 +1004,7 @@ |
1004 | 1004 | list_del_rcu(&oentry->list); |
1005 | 1005 | |
1006 | 1006 | nentry = audit_dupe_rule(&oentry->rule, nwatch); |
1007 | - if (unlikely(IS_ERR(nentry))) | |
1007 | + if (IS_ERR(nentry)) | |
1008 | 1008 | audit_panic("error updating watch, removing"); |
1009 | 1009 | else { |
1010 | 1010 | int h = audit_hash_ino((u32)ino); |
... | ... | @@ -1785,7 +1785,7 @@ |
1785 | 1785 | watch = entry->rule.watch; |
1786 | 1786 | tree = entry->rule.tree; |
1787 | 1787 | nentry = audit_dupe_rule(&entry->rule, watch); |
1788 | - if (unlikely(IS_ERR(nentry))) { | |
1788 | + if (IS_ERR(nentry)) { | |
1789 | 1789 | /* save the first error encountered for the |
1790 | 1790 | * return value */ |
1791 | 1791 | if (!err) |
net/core/dev.c
net/ipv4/af_inet.c
net/netfilter/nf_queue.c
net/xfrm/xfrm_output.c
sound/sh/aica.c