Commit 801678c5a3b4c79236970bcca27c733f5559e0d1

Authored by Hirofumi Nakagawa
Committed by Linus Torvalds
1 parent 9a6f70bbed

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

... ... @@ -339,7 +339,7 @@
339 339 }
340 340  
341 341 req = nbd_find_request(lo, *(struct request **)reply.handle);
342   - if (unlikely(IS_ERR(req))) {
  342 + if (IS_ERR(req)) {
343 343 result = PTR_ERR(req);
344 344 if (result != -ENOENT)
345 345 goto harderror;
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
... ... @@ -2437,7 +2437,7 @@
2437 2437 int status;
2438 2438  
2439 2439 segs = skb_gso_segment(skb, dev->features & ~NETIF_F_TSO6);
2440   - if (unlikely(IS_ERR(segs)))
  2440 + if (IS_ERR(segs))
2441 2441 goto drop;
2442 2442  
2443 2443 while (segs) {
... ... @@ -4361,7 +4361,7 @@
4361 4361 }
4362 4362  
4363 4363 segs = skb_gso_segment(skb, tp->dev->features & ~NETIF_F_TSO);
4364   - if (unlikely(IS_ERR(segs)))
  4364 + if (IS_ERR(segs))
4365 4365 goto tg3_tso_bug_end;
4366 4366  
4367 4367 do {
drivers/rtc/rtc-bfin.c
... ... @@ -419,7 +419,7 @@
419 419 return -ENOMEM;
420 420  
421 421 rtc->rtc_dev = rtc_device_register(pdev->name, &pdev->dev, &bfin_rtc_ops, THIS_MODULE);
422   - if (unlikely(IS_ERR(rtc))) {
  422 + if (IS_ERR(rtc)) {
423 423 ret = PTR_ERR(rtc->rtc_dev);
424 424 goto err;
425 425 }
drivers/scsi/scsi_scan.c
... ... @@ -1828,7 +1828,7 @@
1828 1828 }
1829 1829  
1830 1830 p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no);
1831   - if (unlikely(IS_ERR(p)))
  1831 + if (IS_ERR(p))
1832 1832 do_scan_async(data);
1833 1833 }
1834 1834 EXPORT_SYMBOL(scsi_scan_host);
... ... @@ -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 }
... ... @@ -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);
... ... @@ -598,7 +598,7 @@
598 598 }
599 599  
600 600 ih = inotify_init(&inotify_user_ops);
601   - if (unlikely(IS_ERR(ih))) {
  601 + if (IS_ERR(ih)) {
602 602 ret = PTR_ERR(ih);
603 603 goto out_free_dev;
604 604 }
... ... @@ -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)
... ... @@ -1524,7 +1524,7 @@
1524 1524 if (!segs)
1525 1525 return 0;
1526 1526  
1527   - if (unlikely(IS_ERR(segs)))
  1527 + if (IS_ERR(segs))
1528 1528 return PTR_ERR(segs);
1529 1529  
1530 1530 skb->next = segs;
... ... @@ -1234,7 +1234,7 @@
1234 1234 segs = ops->gso_segment(skb, features);
1235 1235 rcu_read_unlock();
1236 1236  
1237   - if (!segs || unlikely(IS_ERR(segs)))
  1237 + if (!segs || IS_ERR(segs))
1238 1238 goto out;
1239 1239  
1240 1240 skb = segs;
net/netfilter/nf_queue.c
... ... @@ -214,7 +214,7 @@
214 214  
215 215 segs = skb_gso_segment(skb, 0);
216 216 kfree_skb(skb);
217   - if (unlikely(IS_ERR(segs)))
  217 + if (IS_ERR(segs))
218 218 return 1;
219 219  
220 220 do {
net/xfrm/xfrm_output.c
... ... @@ -150,7 +150,7 @@
150 150  
151 151 segs = skb_gso_segment(skb, 0);
152 152 kfree_skb(skb);
153   - if (unlikely(IS_ERR(segs)))
  153 + if (IS_ERR(segs))
154 154 return PTR_ERR(segs);
155 155  
156 156 do {
... ... @@ -663,7 +663,7 @@
663 663 return err;
664 664 pd = platform_device_register_simple(SND_AICA_DRIVER, -1,
665 665 aica_memory_space, 2);
666   - if (unlikely(IS_ERR(pd))) {
  666 + if (IS_ERR(pd)) {
667 667 platform_driver_unregister(&snd_aica_driver);
668 668 return PTR_ERR(pd);
669 669 }