From nobody Wed May 15 03:06:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=quarantine dis=quarantine) header.from=huawei.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1692247729290334.06663654480633; Wed, 16 Aug 2023 21:48:49 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.585110.916128 (Exim 4.92) (envelope-from ) id 1qWUvO-0000gs-IV; Thu, 17 Aug 2023 04:47:58 +0000 Received: by outflank-mailman (output) from mailman id 585110.916128; Thu, 17 Aug 2023 04:47:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qWUvO-0000gl-Fv; Thu, 17 Aug 2023 04:47:58 +0000 Received: by outflank-mailman (input) for mailman id 585110; Thu, 17 Aug 2023 01:47:59 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qWS7D-0006xw-06 for xen-devel@lists.xenproject.org; Thu, 17 Aug 2023 01:47:59 +0000 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 153b6397-3ca0-11ee-8779-cb3800f73035; Thu, 17 Aug 2023 03:47:56 +0200 (CEST) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4RR79L20WdzFqhV; Thu, 17 Aug 2023 09:44:54 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 17 Aug 2023 09:47:52 +0800 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 153b6397-3ca0-11ee-8779-cb3800f73035 From: Li Zetao To: , , , CC: , , Subject: [PATCH -next] xen: xenbus: Use helper function IS_ERR_OR_NULL() Date: Thu, 17 Aug 2023 09:47:36 +0800 Message-ID: <20230817014736.3094289-1-lizetao1@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected X-ZM-MESSAGEID: 1692247731312100001 Content-Type: text/plain; charset="utf-8" Use IS_ERR_OR_NULL() to detect an error pointer or a null pointer open-coding to simplify the code. Signed-off-by: Li Zetao --- drivers/xen/xenbus/xenbus_probe_frontend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbu= s/xenbus_probe_frontend.c index 3f3836cb7279..fcb335bb7b18 100644 --- a/drivers/xen/xenbus/xenbus_probe_frontend.c +++ b/drivers/xen/xenbus/xenbus_probe_frontend.c @@ -429,7 +429,7 @@ static void xenbus_check_frontend(char *class, char *de= v) printk(KERN_DEBUG "XENBUS: frontend %s %s\n", frontend, xenbus_strstate(fe_state)); backend =3D xenbus_read(XBT_NIL, frontend, "backend", NULL); - if (!backend || IS_ERR(backend)) + if (IS_ERR_OR_NULL(backend)) goto out; err =3D xenbus_scanf(XBT_NIL, backend, "state", "%i", &be_state); if (err =3D=3D 1) --=20 2.34.1