Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp653403imm; Wed, 26 Sep 2018 04:54:14 -0700 (PDT) X-Google-Smtp-Source: ACcGV61cZ5yFrqj34G1zlhmptPOlhF+3KQlY6IcetOIo9K+EU/n9DhKya6mn+q9bJx/tCq8vtAqY X-Received: by 2002:a63:2c8e:: with SMTP id s136-v6mr5549309pgs.390.1537962854571; Wed, 26 Sep 2018 04:54:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537962854; cv=none; d=google.com; s=arc-20160816; b=jcAqeIText8xYfOS1+nMvHTqUYS+xYX6gMjVch35H8uYyVXTgxmp4QgPsRPysVFiV7 0gScRvZQn4FA+1LNPksmCuuxM0eDvm2zCLUdv7PtrcvTQuF7khXJms9u2mChj2V0TRg5 53XkXR/s5mMhah/e8OlyC55aI7sRQcuYkGG8n1Hv0VAvAt7netOu453nJe77svheNgCW 83bK1ZUEdXwvPwYRiYBgLgtTiS/1D6KOeb9edYaqNRI5F2KdVUaAY0rLrXnLGGuwCzG+ ZhaqV+Alahs61hxSI0gQkLb0Mn66G8ZAtfM73mbI6zzZF87UPvo7ys74w0J3mipCaZpE 4Stg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=oQYeNO81x6cjlx5DtRT/jG6jXl/vGsp+NGKZyHc+4sc=; b=XLzjbjjV3dqaodomZdSe7d6zNd2WLXK9R/sq1LCSV9TV0OVWVbV2C0mX5sM52C7GoN QLfKouyASCL+V9ROFYvM45dPpYQOcChoxiUBY7vhMl4eVFWDFMDUR5KjpxqiUpjYl/i1 a4FvpsxMF/AE0WXGMK3Zd9r+DRt6OpkQrJOldtnc/jnFoLbYnaurRjwK3aHX35lIZ59D xQ74RgMPnNt7j9T5xEqa7KTA6Y4NnvJrYkHfofJ3EG8l9TYASIC0wIDT//02Mh2tZx0n THsXIfcZAoaclkxSHXzlr1+q6cM5NlIi8V+L8wr7nuhAMwuVUGM8H2xuqOY50vv1O8Et QYGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9-v6si5258850pll.138.2018.09.26.04.53.59; Wed, 26 Sep 2018 04:54:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728204AbeIZSG1 (ORCPT + 99 others); Wed, 26 Sep 2018 14:06:27 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:32829 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726841AbeIZSG1 (ORCPT ); Wed, 26 Sep 2018 14:06:27 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 60B66AD1920EE; Wed, 26 Sep 2018 19:53:43 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.399.0; Wed, 26 Sep 2018 19:53:39 +0800 From: zhong jiang To: CC: , , , Subject: [PATCH] misc: cxl: Move a deference below a NULL test Date: Wed, 26 Sep 2018 19:41:12 +0800 Message-ID: <1537962072-13732-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is safe to move a deference below a NULL test. Signed-off-by: zhong jiang --- 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