mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: liubin001@208suo.com
To: djwong@kernel.org
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] 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.
Date: Fri, 14 Jul 2023 14:26:08 +0800	[thread overview]
Message-ID: <e48842634c7d7ee1123d1887e7a04377@208suo.com> (raw)
In-Reply-To: <tencent_31C29C1E7BD35451F49750644121169CB608@qq.com>

xfs:The if statement uses an assignment statement as a condition, which 
is confusing.
Signed-off-by: Liu Bin <liubin001@208suo.com>
---
  fs/xfs/xfs_trans_dquot.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
index aa00cf67ad72..b429e95e425a 100644
--- a/fs/xfs/xfs_trans_dquot.c
+++ b/fs/xfs/xfs_trans_dquot.c
@@ -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

       reply	other threads:[~2023-07-14  6:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tencent_31C29C1E7BD35451F49750644121169CB608@qq.com>
2023-07-14  6:26 ` liubin001 [this message]
2023-07-14  6:35   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e48842634c7d7ee1123d1887e7a04377@208suo.com \
    --to=liubin001@208suo.com \
    --cc=djwong@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®