From patchwork Wed Jan 30 06:57:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [ext4] minor. consecutive shift is not necessary Date: Tue, 29 Jan 2013 20:57:58 -0000 From: Anders Lind X-Patchwork-Id: 216775 Message-Id: <1359529078.28633.YahooMailNeo@web164603.mail.gq1.yahoo.com> To: "linux-ext4@vger.kernel.org" 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 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);  }