aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHirofumi Nakagawa <hnakagawa@miraclelinux.com>2008-04-29 04:03:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:25 -0400
commit801678c5a3b4c79236970bcca27c733f5559e0d1 (patch)
tree5ad4761f539525077895f261b64fccda4d1303c4
parent9a6f70bbed4e8b72dd340812d7c606bfd5e00b47 (diff)
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>
-rw-r--r--drivers/block/nbd.c2
-rw-r--r--drivers/leds/led-class.c2
-rw-r--r--drivers/message/i2o/i2o_block.c2
-rw-r--r--drivers/net/myri10ge/myri10ge.c2
-rw-r--r--drivers/net/tg3.c2
-rw-r--r--drivers/rtc/rtc-bfin.c2
-rw-r--r--drivers/scsi/scsi_scan.c2
-rw-r--r--fs/aio.c2
-rw-r--r--fs/ecryptfs/inode.c2
-rw-r--r--fs/inotify_user.c2
-rw-r--r--fs/ntfs/mft.c6
-rw-r--r--kernel/auditfilter.c10
-rw-r--r--net/core/dev.c2
-rw-r--r--net/ipv4/af_inet.c2
-rw-r--r--net/netfilter/nf_queue.c2
-rw-r--r--net/xfrm/xfrm_output.c2
-rw-r--r--sound/sh/aica.c2
17 files changed, 23 insertions, 23 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index a3da198ca429..bdba282f15e4 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -339,7 +339,7 @@ static struct request *nbd_read_stat(struct nbd_device *lo)
339 } 339 }
340 340
341 req = nbd_find_request(lo, *(struct request **)reply.handle); 341 req = nbd_find_request(lo, *(struct request **)reply.handle);
342 if (unlikely(IS_ERR(req))) { 342 if (IS_ERR(req)) {
343 result = PTR_ERR(req); 343 result = PTR_ERR(req);
344 if (result != -ENOENT) 344 if (result != -ENOENT)
345 goto harderror; 345 goto harderror;
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index ac05a928f764..b3c54be74556 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -105,7 +105,7 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
105 105
106 led_cdev->dev = device_create(leds_class, parent, 0, "%s", 106 led_cdev->dev = device_create(leds_class, parent, 0, "%s",
107 led_cdev->name); 107 led_cdev->name);
108 if (unlikely(IS_ERR(led_cdev->dev))) 108 if (IS_ERR(led_cdev->dev))
109 return PTR_ERR(led_cdev->dev); 109 return PTR_ERR(led_cdev->dev);
110 110
111 dev_set_drvdata(led_cdev->dev, led_cdev); 111 dev_set_drvdata(led_cdev->dev, led_cdev);
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index a95314897402..81483de8c0fd 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -371,7 +371,7 @@ static int i2o_block_prep_req_fn(struct request_queue *q, struct request *req)
371 /* connect the i2o_block_request to the request */ 371 /* connect the i2o_block_request to the request */
372 if (!req->special) { 372 if (!req->special) {
373 ireq = i2o_block_request_alloc(); 373 ireq = i2o_block_request_alloc();
374 if (unlikely(IS_ERR(ireq))) { 374 if (IS_ERR(ireq)) {
375 osm_debug("unable to allocate i2o_block_request!\n"); 375 osm_debug("unable to allocate i2o_block_request!\n");
376 return BLKPREP_DEFER; 376 return BLKPREP_DEFER;
377 } 377 }
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index cead81e80f0c..ef63c8d2bd7e 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -2437,7 +2437,7 @@ static int myri10ge_sw_tso(struct sk_buff *skb, struct net_device *dev)
2437 int status; 2437 int status;
2438 2438
2439 segs = skb_gso_segment(skb, dev->features & ~NETIF_F_TSO6); 2439 segs = skb_gso_segment(skb, dev->features & ~NETIF_F_TSO6);
2440 if (unlikely(IS_ERR(segs))) 2440 if (IS_ERR(segs))
2441 goto drop; 2441 goto drop;
2442 2442
2443 while (segs) { 2443 while (segs) {
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index e3f74c9f78bd..b66c75e3b8a1 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -4361,7 +4361,7 @@ static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb)
4361 } 4361 }
4362 4362
4363 segs = skb_gso_segment(skb, tp->dev->features & ~NETIF_F_TSO); 4363 segs = skb_gso_segment(skb, tp->dev->features & ~NETIF_F_TSO);
4364 if (unlikely(IS_ERR(segs))) 4364 if (IS_ERR(segs))
4365 goto tg3_tso_bug_end; 4365 goto tg3_tso_bug_end;
4366 4366
4367 do { 4367 do {
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c
index 4f28045d9ef2..8624f55d0560 100644
--- a/drivers/rtc/rtc-bfin.c
+++ b/drivers/rtc/rtc-bfin.c
@@ -419,7 +419,7 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev)
419 return -ENOMEM; 419 return -ENOMEM;
420 420
421 rtc->rtc_dev = rtc_device_register(pdev->name, &pdev->dev, &bfin_rtc_ops, THIS_MODULE); 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 ret = PTR_ERR(rtc->rtc_dev); 423 ret = PTR_ERR(rtc->rtc_dev);
424 goto err; 424 goto err;
425 } 425 }
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index fcd7455ffc39..a00eee6f7be9 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1828,7 +1828,7 @@ void scsi_scan_host(struct Scsi_Host *shost)
1828 } 1828 }
1829 1829
1830 p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no); 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 do_scan_async(data); 1832 do_scan_async(data);
1833} 1833}
1834EXPORT_SYMBOL(scsi_scan_host); 1834EXPORT_SYMBOL(scsi_scan_host);
diff --git a/fs/aio.c b/fs/aio.c
index 81c01290939b..a175ad650b66 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1604,7 +1604,7 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
1604 * event using the eventfd_signal() function. 1604 * event using the eventfd_signal() function.
1605 */ 1605 */
1606 req->ki_eventfd = eventfd_fget((int) iocb->aio_resfd); 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 ret = PTR_ERR(req->ki_eventfd); 1608 ret = PTR_ERR(req->ki_eventfd);
1609 goto out_put_req; 1609 goto out_put_req;
1610 } 1610 }
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 1623ebf25e51..0a1397335a8e 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -111,7 +111,7 @@ ecryptfs_do_create(struct inode *directory_inode,
111 111
112 lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry); 112 lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry);
113 lower_dir_dentry = lock_parent(lower_dentry); 113 lower_dir_dentry = lock_parent(lower_dentry);
114 if (unlikely(IS_ERR(lower_dir_dentry))) { 114 if (IS_ERR(lower_dir_dentry)) {
115 ecryptfs_printk(KERN_ERR, "Error locking directory of " 115 ecryptfs_printk(KERN_ERR, "Error locking directory of "
116 "dentry\n"); 116 "dentry\n");
117 rc = PTR_ERR(lower_dir_dentry); 117 rc = PTR_ERR(lower_dir_dentry);
diff --git a/fs/inotify_user.c b/fs/inotify_user.c
index 7b94a1e3c015..6676c06bb7c1 100644
--- a/fs/inotify_user.c
+++ b/fs/inotify_user.c
@@ -598,7 +598,7 @@ asmlinkage long sys_inotify_init(void)
598 } 598 }
599 599
600 ih = inotify_init(&inotify_user_ops); 600 ih = inotify_init(&inotify_user_ops);
601 if (unlikely(IS_ERR(ih))) { 601 if (IS_ERR(ih)) {
602 ret = PTR_ERR(ih); 602 ret = PTR_ERR(ih);
603 goto out_free_dev; 603 goto out_free_dev;
604 } 604 }
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c
index 2ad5c8b104b9..790defb847e7 100644
--- a/fs/ntfs/mft.c
+++ b/fs/ntfs/mft.c
@@ -1191,7 +1191,7 @@ static int ntfs_mft_bitmap_find_and_alloc_free_rec_nolock(ntfs_volume *vol,
1191 if (size) { 1191 if (size) {
1192 page = ntfs_map_page(mftbmp_mapping, 1192 page = ntfs_map_page(mftbmp_mapping,
1193 ofs >> PAGE_CACHE_SHIFT); 1193 ofs >> PAGE_CACHE_SHIFT);
1194 if (unlikely(IS_ERR(page))) { 1194 if (IS_ERR(page)) {
1195 ntfs_error(vol->sb, "Failed to read mft " 1195 ntfs_error(vol->sb, "Failed to read mft "
1196 "bitmap, aborting."); 1196 "bitmap, aborting.");
1197 return PTR_ERR(page); 1197 return PTR_ERR(page);
@@ -2118,7 +2118,7 @@ static int ntfs_mft_record_format(const ntfs_volume *vol, const s64 mft_no)
2118 } 2118 }
2119 /* Read, map, and pin the page containing the mft record. */ 2119 /* Read, map, and pin the page containing the mft record. */
2120 page = ntfs_map_page(mft_vi->i_mapping, index); 2120 page = ntfs_map_page(mft_vi->i_mapping, index);
2121 if (unlikely(IS_ERR(page))) { 2121 if (IS_ERR(page)) {
2122 ntfs_error(vol->sb, "Failed to map page containing mft record " 2122 ntfs_error(vol->sb, "Failed to map page containing mft record "
2123 "to format 0x%llx.", (long long)mft_no); 2123 "to format 0x%llx.", (long long)mft_no);
2124 return PTR_ERR(page); 2124 return PTR_ERR(page);
@@ -2519,7 +2519,7 @@ mft_rec_already_initialized:
2519 ofs = (bit << vol->mft_record_size_bits) & ~PAGE_CACHE_MASK; 2519 ofs = (bit << vol->mft_record_size_bits) & ~PAGE_CACHE_MASK;
2520 /* Read, map, and pin the page containing the mft record. */ 2520 /* Read, map, and pin the page containing the mft record. */
2521 page = ntfs_map_page(vol->mft_ino->i_mapping, index); 2521 page = ntfs_map_page(vol->mft_ino->i_mapping, index);
2522 if (unlikely(IS_ERR(page))) { 2522 if (IS_ERR(page)) {
2523 ntfs_error(vol->sb, "Failed to map page containing allocated " 2523 ntfs_error(vol->sb, "Failed to map page containing allocated "
2524 "mft record 0x%llx.", (long long)bit); 2524 "mft record 0x%llx.", (long long)bit);
2525 err = PTR_ERR(page); 2525 err = PTR_ERR(page);
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 28fef6bf8534..13430176b3c9 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -272,7 +272,7 @@ static int audit_to_watch(struct audit_krule *krule, char *path, int len,
272 return -EINVAL; 272 return -EINVAL;
273 273
274 watch = audit_init_watch(path); 274 watch = audit_init_watch(path);
275 if (unlikely(IS_ERR(watch))) 275 if (IS_ERR(watch))
276 return PTR_ERR(watch); 276 return PTR_ERR(watch);
277 277
278 audit_get_watch(watch); 278 audit_get_watch(watch);
@@ -848,7 +848,7 @@ static struct audit_watch *audit_dupe_watch(struct audit_watch *old)
848 return ERR_PTR(-ENOMEM); 848 return ERR_PTR(-ENOMEM);
849 849
850 new = audit_init_watch(path); 850 new = audit_init_watch(path);
851 if (unlikely(IS_ERR(new))) { 851 if (IS_ERR(new)) {
852 kfree(path); 852 kfree(path);
853 goto out; 853 goto out;
854 } 854 }
@@ -989,7 +989,7 @@ static void audit_update_watch(struct audit_parent *parent,
989 audit_set_auditable(current->audit_context); 989 audit_set_auditable(current->audit_context);
990 990
991 nwatch = audit_dupe_watch(owatch); 991 nwatch = audit_dupe_watch(owatch);
992 if (unlikely(IS_ERR(nwatch))) { 992 if (IS_ERR(nwatch)) {
993 mutex_unlock(&audit_filter_mutex); 993 mutex_unlock(&audit_filter_mutex);
994 audit_panic("error updating watch, skipping"); 994 audit_panic("error updating watch, skipping");
995 return; 995 return;
@@ -1004,7 +1004,7 @@ static void audit_update_watch(struct audit_parent *parent,
1004 list_del_rcu(&oentry->list); 1004 list_del_rcu(&oentry->list);
1005 1005
1006 nentry = audit_dupe_rule(&oentry->rule, nwatch); 1006 nentry = audit_dupe_rule(&oentry->rule, nwatch);
1007 if (unlikely(IS_ERR(nentry))) 1007 if (IS_ERR(nentry))
1008 audit_panic("error updating watch, removing"); 1008 audit_panic("error updating watch, removing");
1009 else { 1009 else {
1010 int h = audit_hash_ino((u32)ino); 1010 int h = audit_hash_ino((u32)ino);
@@ -1785,7 +1785,7 @@ int audit_update_lsm_rules(void)
1785 watch = entry->rule.watch; 1785 watch = entry->rule.watch;
1786 tree = entry->rule.tree; 1786 tree = entry->rule.tree;
1787 nentry = audit_dupe_rule(&entry->rule, watch); 1787 nentry = audit_dupe_rule(&entry->rule, watch);
1788 if (unlikely(IS_ERR(nentry))) { 1788 if (IS_ERR(nentry)) {
1789 /* save the first error encountered for the 1789 /* save the first error encountered for the
1790 * return value */ 1790 * return value */
1791 if (!err) 1791 if (!err)
diff --git a/net/core/dev.c b/net/core/dev.c
index e1df1ab3e04a..ed49da592051 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1524,7 +1524,7 @@ static int dev_gso_segment(struct sk_buff *skb)
1524 if (!segs) 1524 if (!segs)
1525 return 0; 1525 return 0;
1526 1526
1527 if (unlikely(IS_ERR(segs))) 1527 if (IS_ERR(segs))
1528 return PTR_ERR(segs); 1528 return PTR_ERR(segs);
1529 1529
1530 skb->next = segs; 1530 skb->next = segs;
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index f2b5270efdaa..24eca23c2db3 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1234,7 +1234,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
1234 segs = ops->gso_segment(skb, features); 1234 segs = ops->gso_segment(skb, features);
1235 rcu_read_unlock(); 1235 rcu_read_unlock();
1236 1236
1237 if (!segs || unlikely(IS_ERR(segs))) 1237 if (!segs || IS_ERR(segs))
1238 goto out; 1238 goto out;
1239 1239
1240 skb = segs; 1240 skb = segs;
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index bbd26893c0c4..582ec3efc8a5 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -214,7 +214,7 @@ int nf_queue(struct sk_buff *skb,
214 214
215 segs = skb_gso_segment(skb, 0); 215 segs = skb_gso_segment(skb, 0);
216 kfree_skb(skb); 216 kfree_skb(skb);
217 if (unlikely(IS_ERR(segs))) 217 if (IS_ERR(segs))
218 return 1; 218 return 1;
219 219
220 do { 220 do {
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 2519129c6d21..09cd9c0c2d80 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -150,7 +150,7 @@ static int xfrm_output_gso(struct sk_buff *skb)
150 150
151 segs = skb_gso_segment(skb, 0); 151 segs = skb_gso_segment(skb, 0);
152 kfree_skb(skb); 152 kfree_skb(skb);
153 if (unlikely(IS_ERR(segs))) 153 if (IS_ERR(segs))
154 return PTR_ERR(segs); 154 return PTR_ERR(segs);
155 155
156 do { 156 do {
diff --git a/sound/sh/aica.c b/sound/sh/aica.c
index d49417bf78c6..9ca113326143 100644
--- a/sound/sh/aica.c
+++ b/sound/sh/aica.c
@@ -663,7 +663,7 @@ static int __init aica_init(void)
663 return err; 663 return err;
664 pd = platform_device_register_simple(SND_AICA_DRIVER, -1, 664 pd = platform_device_register_simple(SND_AICA_DRIVER, -1,
665 aica_memory_space, 2); 665 aica_memory_space, 2);
666 if (unlikely(IS_ERR(pd))) { 666 if (IS_ERR(pd)) {
667 platform_driver_unregister(&snd_aica_driver); 667 platform_driver_unregister(&snd_aica_driver);
668 return PTR_ERR(pd); 668 return PTR_ERR(pd);
669 } 669 }