[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1359529078.28633.YahooMailNeo@web164603.mail.gq1.yahoo.com>
Date: Tue, 29 Jan 2013 22:57:58 -0800 (PST)
From: Anders Lind <anderslindgaard@...oo.com>
To: "linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>
Subject: [ext4] minor. consecutive shift is not necessary
Hi,
Since pb is at least 64-bits, shifting by 32 will not invoke UB. I dont see reason doing that.
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);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists