linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: <gregkh@linuxfoundation.org>
Cc: <fbarrat@linux.vnet.ibm.com>, <andrew.donnellan@au1.ibm.com>,
	<arnd@arndb.de>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] misc: cxl: Move a deference below a NULL test
Date: Wed, 26 Sep 2018 19:41:12 +0800	[thread overview]
Message-ID: <1537962072-13732-1-git-send-email-zhongjiang@huawei.com> (raw)

It is safe to move a deference below a NULL test.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/misc/cxl/guest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c
index 3bc0c15..559e835 100644
--- a/drivers/misc/cxl/guest.c
+++ b/drivers/misc/cxl/guest.c
@@ -1018,11 +1018,11 @@ int cxl_guest_init_afu(struct cxl *adapter, int slice, struct device_node *afu_n
 
 void cxl_guest_remove_afu(struct cxl_afu *afu)
 {
-	pr_devel("in %s - AFU(%d)\n", __func__, afu->slice);
-
 	if (!afu)
 		return;
 
+	pr_devel("in %s - AFU(%d)\n", __func__, afu->slice);
+
 	/* flush and stop pending job */
 	afu->guest->handle_err = false;
 	flush_delayed_work(&afu->guest->work_err);
-- 
1.7.12.4


             reply	other threads:[~2018-09-26 11:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 11:41 zhong jiang [this message]
2018-09-26 23:46 ` [PATCH] misc: cxl: Move a deference below a NULL test Andrew Donnellan
2018-10-02 22:55 ` Greg KH
2018-10-04  2:45   ` zhong jiang

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=1537962072-13732-1-git-send-email-zhongjiang@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=andrew.donnellan@au1.ibm.com \
    --cc=arnd@arndb.de \
    --cc=fbarrat@linux.vnet.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).