[ext4] minor. consecutive shift is not necessary

Submitted by Anders Lind on Jan. 30, 2013, 6:57 a.m.

Details

Message ID 1359529078.28633.YahooMailNeo@web164603.mail.gq1.yahoo.com
State Accepted, archived
Headers show

Commit Message

Anders Lind Jan. 30, 2013, 6:57 a.m.
Hi,

Since pb is at least 64-bits, shifting by 32 will not invoke UB. I dont see reason doing that.


--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch hide | download patch | download mbox

diff --git a/fs/ext4/ext4_extents.h b/fs/ext4/ext4_extents.h
index 487fda1..eb40d98 100644
--- a/fs/ext4/ext4_extents.h
+++ b/fs/ext4/ext4_extents.h
@@ -259,7 +259,7 @@  static inline void ext4_ext_store_pblock(struct ext4_extent *ex,
                                         ext4_fsblk_t pb)
 {
        ex->ee_start_lo = cpu_to_le32((unsigned long) (pb & 0xffffffff));
-       ex->ee_start_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) &
+       ex->ee_start_hi = cpu_to_le16((unsigned long) (pb >> 32) &
                                      0xffff);
 }
 
@@ -272,7 +272,7 @@  static inline void ext4_idx_store_pblock(struct ext4_extent_idx *ix,
                                         ext4_fsblk_t pb)
 {
        ix->ei_leaf_lo = cpu_to_le32((unsigned long) (pb & 0xffffffff));
-       ix->ei_leaf_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) &
+       ix->ei_leaf_hi = cpu_to_le16((unsigned long) (pb >> 32)  &
                                     0xffff);
 }