Skip to content

Commit cc22c80

Browse files
evdenistorvalds
authored andcommitted
ntfs: remove (un)?likely() from IS_ERR() conditions
"likely(!IS_ERR(x))" is excessive. IS_ERR() already uses unlikely() internally. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Denis Efremov <[email protected]> Cc: Anton Altaparmakov <[email protected]> Cc: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7b0b692 commit cc22c80

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

fs/ntfs/mft.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static inline MFT_RECORD *map_mft_record_page(ntfs_inode *ni)
7171
}
7272
/* Read, map, and pin the page. */
7373
page = ntfs_map_page(mft_vi->i_mapping, index);
74-
if (likely(!IS_ERR(page))) {
74+
if (!IS_ERR(page)) {
7575
/* Catch multi sector transfer fixup errors. */
7676
if (likely(ntfs_is_mft_recordp((le32*)(page_address(page) +
7777
ofs)))) {
@@ -154,7 +154,7 @@ MFT_RECORD *map_mft_record(ntfs_inode *ni)
154154
mutex_lock(&ni->mrec_lock);
155155

156156
m = map_mft_record_page(ni);
157-
if (likely(!IS_ERR(m)))
157+
if (!IS_ERR(m))
158158
return m;
159159

160160
mutex_unlock(&ni->mrec_lock);
@@ -271,7 +271,7 @@ MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref,
271271
m = map_mft_record(ni);
272272
/* map_mft_record() has incremented this on success. */
273273
atomic_dec(&ni->count);
274-
if (likely(!IS_ERR(m))) {
274+
if (!IS_ERR(m)) {
275275
/* Verify the sequence number. */
276276
if (likely(le16_to_cpu(m->sequence_number) == seq_no)) {
277277
ntfs_debug("Done 1.");
@@ -1303,7 +1303,7 @@ static int ntfs_mft_bitmap_extend_allocation_nolock(ntfs_volume *vol)
13031303
read_unlock_irqrestore(&mftbmp_ni->size_lock, flags);
13041304
rl = ntfs_attr_find_vcn_nolock(mftbmp_ni,
13051305
(ll - 1) >> vol->cluster_size_bits, NULL);
1306-
if (unlikely(IS_ERR(rl) || !rl->length || rl->lcn < 0)) {
1306+
if (IS_ERR(rl) || unlikely(!rl->length || rl->lcn < 0)) {
13071307
up_write(&mftbmp_ni->runlist.lock);
13081308
ntfs_error(vol->sb, "Failed to determine last allocated "
13091309
"cluster of mft bitmap attribute.");
@@ -1734,7 +1734,7 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol)
17341734
read_unlock_irqrestore(&mft_ni->size_lock, flags);
17351735
rl = ntfs_attr_find_vcn_nolock(mft_ni,
17361736
(ll - 1) >> vol->cluster_size_bits, NULL);
1737-
if (unlikely(IS_ERR(rl) || !rl->length || rl->lcn < 0)) {
1737+
if (IS_ERR(rl) || unlikely(!rl->length || rl->lcn < 0)) {
17381738
up_write(&mft_ni->runlist.lock);
17391739
ntfs_error(vol->sb, "Failed to determine last allocated "
17401740
"cluster of mft data attribute.");
@@ -1776,7 +1776,7 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol)
17761776
do {
17771777
rl2 = ntfs_cluster_alloc(vol, old_last_vcn, nr, lcn, MFT_ZONE,
17781778
true);
1779-
if (likely(!IS_ERR(rl2)))
1779+
if (!IS_ERR(rl2))
17801780
break;
17811781
if (PTR_ERR(rl2) != -ENOSPC || nr == min_nr) {
17821782
ntfs_error(vol->sb, "Failed to allocate the minimal "

fs/ntfs/namei.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent,
115115
dent_ino = MREF(mref);
116116
ntfs_debug("Found inode 0x%lx. Calling ntfs_iget.", dent_ino);
117117
dent_inode = ntfs_iget(vol->sb, dent_ino);
118-
if (likely(!IS_ERR(dent_inode))) {
118+
if (!IS_ERR(dent_inode)) {
119119
/* Consistency check. */
120120
if (is_bad_inode(dent_inode) || MSEQNO(mref) ==
121121
NTFS_I(dent_inode)->seq_no ||

fs/ntfs/runlist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ runlist_element *ntfs_mapping_pairs_decompress(const ntfs_volume *vol,
951951
}
952952
/* Now combine the new and old runlists checking for overlaps. */
953953
old_rl = ntfs_runlists_merge(old_rl, rl);
954-
if (likely(!IS_ERR(old_rl)))
954+
if (!IS_ERR(old_rl))
955955
return old_rl;
956956
ntfs_free(rl);
957957
ntfs_error(vol->sb, "Failed to merge runlists.");

fs/ntfs/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ static bool load_and_init_usnjrnl(ntfs_volume *vol)
14751475
kfree(name);
14761476
/* Get the inode. */
14771477
tmp_ino = ntfs_iget(vol->sb, MREF(mref));
1478-
if (unlikely(IS_ERR(tmp_ino) || is_bad_inode(tmp_ino))) {
1478+
if (IS_ERR(tmp_ino) || unlikely(is_bad_inode(tmp_ino))) {
14791479
if (!IS_ERR(tmp_ino))
14801480
iput(tmp_ino);
14811481
ntfs_error(vol->sb, "Failed to load $UsnJrnl.");

0 commit comments

Comments
 (0)