xfs:Comparisons should place the constant on the right side of the test The if statement uses an assignment statement as a condition, which is confusing.
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 xfs:Comparisons should place the constant on the right side of the test The if statement uses an assignment statement as a condition, which is confusing.
xfs:The if statement uses an assignment statement as a condition, which is confusing.
Signed-off-by Liu Bin <[email protected]>
--- fs/xfs/xfs_trans_dquot.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/xfs/xfs_trans_dquot.c +5 -2
@@ -361,7 +361,8 @@ xfs_trans_apply_dquot_deltas(* The array of dquots is filled * sequentially, not sparsely. */ -if ((dqp = qtrx->qt_dquot) ==NULL ) + dqp = qtrx->qt_dquot; +if (dqp ==NULL )break ;ASSERT (XFS_DQ_IS_LOCKED (dqp));
@@ -492,8 +493,10 @@ xfs_trans_unreserve_and_mod_dquots(/* * We assume that the array of dquots is filled * sequentially, not sparsely. +* */ -if ((dqp = qtrx->qt_dquot) ==NULL ) + dqp = qtrx->qt_dquot +if (dqp ==NULL )break ;/* * Unreserve the original reservation. We don't care
Quoted 3 lines · On Fri, Jul 14, 2023 at 02:26:08PM +0800, [email protected] wrote:
xfs:The if statement uses an assignment statement as a condition, which is confusing.
Signed-off-by Liu Bin <[email protected]>
What's the point? I prefer the style you change it to as well, but there is no real downside, and changing code just for the sake of it causes nothing but churn.