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>
This commit is contained in:
committed by
Linus Torvalds
parent
9a6f70bbed
commit
801678c5a3
@ -272,7 +272,7 @@ static int audit_to_watch(struct audit_krule *krule, char *path, int len,
|
||||
return -EINVAL;
|
||||
|
||||
watch = audit_init_watch(path);
|
||||
if (unlikely(IS_ERR(watch)))
|
||||
if (IS_ERR(watch))
|
||||
return PTR_ERR(watch);
|
||||
|
||||
audit_get_watch(watch);
|
||||
@ -848,7 +848,7 @@ static struct audit_watch *audit_dupe_watch(struct audit_watch *old)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
new = audit_init_watch(path);
|
||||
if (unlikely(IS_ERR(new))) {
|
||||
if (IS_ERR(new)) {
|
||||
kfree(path);
|
||||
goto out;
|
||||
}
|
||||
@ -989,7 +989,7 @@ static void audit_update_watch(struct audit_parent *parent,
|
||||
audit_set_auditable(current->audit_context);
|
||||
|
||||
nwatch = audit_dupe_watch(owatch);
|
||||
if (unlikely(IS_ERR(nwatch))) {
|
||||
if (IS_ERR(nwatch)) {
|
||||
mutex_unlock(&audit_filter_mutex);
|
||||
audit_panic("error updating watch, skipping");
|
||||
return;
|
||||
@ -1004,7 +1004,7 @@ static void audit_update_watch(struct audit_parent *parent,
|
||||
list_del_rcu(&oentry->list);
|
||||
|
||||
nentry = audit_dupe_rule(&oentry->rule, nwatch);
|
||||
if (unlikely(IS_ERR(nentry)))
|
||||
if (IS_ERR(nentry))
|
||||
audit_panic("error updating watch, removing");
|
||||
else {
|
||||
int h = audit_hash_ino((u32)ino);
|
||||
@ -1785,7 +1785,7 @@ int audit_update_lsm_rules(void)
|
||||
watch = entry->rule.watch;
|
||||
tree = entry->rule.tree;
|
||||
nentry = audit_dupe_rule(&entry->rule, watch);
|
||||
if (unlikely(IS_ERR(nentry))) {
|
||||
if (IS_ERR(nentry)) {
|
||||
/* save the first error encountered for the
|
||||
* return value */
|
||||
if (!err)
|
||||
|
Reference in New Issue
Block a user