diff options
author | David Sterba <dsterba@suse.cz> | 2011-04-13 18:03:28 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2011-04-28 14:25:29 -0400 |
commit | 45c51b99943c4c74165b19dc2f96e8ba93bdecb9 (patch) | |
tree | 4f0beaf22aaa7e931540f3a40a722ab4cfaefafe /fs/xfs | |
parent | 8a072a4d4c6a5b6ec32836c467d2996393c76c6f (diff) |
xfs: cleanup duplicate initializations
follow these guidelines:
- leave initialization in the declaration block if it fits the line
- move to the code where it's more suitable ('for' init block)
The last chunk was modified from David's original to be a correct
fix for what appeared to be a duplicate initialization.
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_dfrag.c | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_inode_item.c | 1 | ||||
-rw-r--r-- | fs/xfs/xfs_mount.c | 4 |
3 files changed, 3 insertions, 8 deletions
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c index be628677c288..9a84a85c03b1 100644 --- a/fs/xfs/xfs_dfrag.c +++ b/fs/xfs/xfs_dfrag.c | |||
@@ -202,7 +202,7 @@ xfs_swap_extents( | |||
202 | xfs_inode_t *tip, /* tmp inode */ | 202 | xfs_inode_t *tip, /* tmp inode */ |
203 | xfs_swapext_t *sxp) | 203 | xfs_swapext_t *sxp) |
204 | { | 204 | { |
205 | xfs_mount_t *mp; | 205 | xfs_mount_t *mp = ip->i_mount; |
206 | xfs_trans_t *tp; | 206 | xfs_trans_t *tp; |
207 | xfs_bstat_t *sbp = &sxp->sx_stat; | 207 | xfs_bstat_t *sbp = &sxp->sx_stat; |
208 | xfs_ifork_t *tempifp, *ifp, *tifp; | 208 | xfs_ifork_t *tempifp, *ifp, *tifp; |
@@ -212,16 +212,12 @@ xfs_swap_extents( | |||
212 | int taforkblks = 0; | 212 | int taforkblks = 0; |
213 | __uint64_t tmp; | 213 | __uint64_t tmp; |
214 | 214 | ||
215 | mp = ip->i_mount; | ||
216 | |||
217 | tempifp = kmem_alloc(sizeof(xfs_ifork_t), KM_MAYFAIL); | 215 | tempifp = kmem_alloc(sizeof(xfs_ifork_t), KM_MAYFAIL); |
218 | if (!tempifp) { | 216 | if (!tempifp) { |
219 | error = XFS_ERROR(ENOMEM); | 217 | error = XFS_ERROR(ENOMEM); |
220 | goto out; | 218 | goto out; |
221 | } | 219 | } |
222 | 220 | ||
223 | sbp = &sxp->sx_stat; | ||
224 | |||
225 | /* | 221 | /* |
226 | * we have to do two separate lock calls here to keep lockdep | 222 | * we have to do two separate lock calls here to keep lockdep |
227 | * happy. If we try to get all the locks in one call, lock will | 223 | * happy. If we try to get all the locks in one call, lock will |
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 576fdfe81d60..09983a3344a5 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
@@ -970,7 +970,6 @@ xfs_iflush_abort( | |||
970 | { | 970 | { |
971 | xfs_inode_log_item_t *iip = ip->i_itemp; | 971 | xfs_inode_log_item_t *iip = ip->i_itemp; |
972 | 972 | ||
973 | iip = ip->i_itemp; | ||
974 | if (iip) { | 973 | if (iip) { |
975 | struct xfs_ail *ailp = iip->ili_item.li_ailp; | 974 | struct xfs_ail *ailp = iip->ili_item.li_ailp; |
976 | if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { | 975 | if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { |
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index bb3f9a7b24ed..b49b82363d20 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -1900,7 +1900,7 @@ xfs_mod_incore_sb_batch( | |||
1900 | uint nmsb, | 1900 | uint nmsb, |
1901 | int rsvd) | 1901 | int rsvd) |
1902 | { | 1902 | { |
1903 | xfs_mod_sb_t *msbp = &msb[0]; | 1903 | xfs_mod_sb_t *msbp; |
1904 | int error = 0; | 1904 | int error = 0; |
1905 | 1905 | ||
1906 | /* | 1906 | /* |
@@ -1910,7 +1910,7 @@ xfs_mod_incore_sb_batch( | |||
1910 | * changes will be atomic. | 1910 | * changes will be atomic. |
1911 | */ | 1911 | */ |
1912 | spin_lock(&mp->m_sb_lock); | 1912 | spin_lock(&mp->m_sb_lock); |
1913 | for (msbp = &msbp[0]; msbp < (msb + nmsb); msbp++) { | 1913 | for (msbp = msb; msbp < (msb + nmsb); msbp++) { |
1914 | ASSERT(msbp->msb_field < XFS_SBS_ICOUNT || | 1914 | ASSERT(msbp->msb_field < XFS_SBS_ICOUNT || |
1915 | msbp->msb_field > XFS_SBS_FDBLOCKS); | 1915 | msbp->msb_field > XFS_SBS_FDBLOCKS); |
1916 | 1916 | ||