Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3039689pxu; Mon, 14 Dec 2020 18:52:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJ2bmTmDPTnLirYQkEU8SOeeJ2yxlhIYAD7loHkPgxI7uMLVQYtFVPjXjhuA3OXTYHWiqK X-Received: by 2002:a17:906:3ec8:: with SMTP id d8mr24862336ejj.32.1608000773191; Mon, 14 Dec 2020 18:52:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608000773; cv=none; d=google.com; s=arc-20160816; b=WMFmczsW67onh/4dcbXzF47LHoogMD6OiOs1yDDySaKk6p7f5WK42Lr67qEAwfwyzd 1kc09LtjM6zGLUAp4x8uy2y+I5VfjECgESI4FdUCsPB9j2mqzeAh57HMAaQo1DB9y1Ey u5/wtwo4IPzqoJ1fpuuGsXsc71B69htgQHJPgtr6ebUWrCltKpb3Zjb+jXxCExTKJ3IG 4kGTIeRfzCNV38zbLT17NixBCJI027DZMhl8SRJGRyZOz+38jAea1a+c4+aXHFYQHurD GJ5WG7VLl68YYflVlcrOYIl9aIMGDnzT5d0Byn2xJTbNUhJPAG9lg73FVCYxasqLrEp1 zrgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=9v3fXvy5Rx+dgL3VYpxRilQrFY1QifUz0UstC6/wr2o=; b=ktiXjaaw3/LYpTR4iLs5vJqdqGR8yGScjKuyEWSfItFlVWZsLJ7+GZybvqccPhmnbd hkVdX5WuApRtWPiclF3E7p+T81jn6LkGywvZ4YQAQSrmB3QusbBW/2jgHbM2irppXBUA YlYkhFOAnT96H4dL2+tuxuAm+l2p25F55GslH+QmoiUqlNFogf1YTkMOPZ9PEbOAdWzo 3PAGi3lysIXyspDqUmL18SrwEOlKYC2mJyw8gSm2O0ViW+Eg5iWJ+PaI0+qXSiDJ1lUm 1gsFsyNGQ7RX4PjnHrhgsBKhxbOh8Hps8GOoq8XsyTIwEQwEb44C4ihxJMBV8pEQNmhn krxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm7si243986ejc.350.2020.12.14.18.52.30; Mon, 14 Dec 2020 18:52:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728267AbgLOCja (ORCPT + 99 others); Mon, 14 Dec 2020 21:39:30 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:9529 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727820AbgLOCjO (ORCPT ); Mon, 14 Dec 2020 21:39:14 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Cw2VT2Dh3zhrph; Tue, 15 Dec 2020 10:37:53 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Tue, 15 Dec 2020 10:38:25 +0800 From: Tian Tao To: , , , , , , CC: , , , Subject: [PATCH] dma-buf: system_heap: Use PTR_ERR_OR_ZERO() to simplify code Date: Tue, 15 Dec 2020 10:38:35 +0800 Message-ID: <1607999915-53034-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes coccicheck warning: drivers/dma-buf/heaps/system_heap.c:437:1-3: WARNING: PTR_ERR_OR_ZERO can be used Signed-off-by: Tian Tao --- drivers/dma-buf/heaps/system_heap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c index 17e0e9a..c5d8a40 100644 --- a/drivers/dma-buf/heaps/system_heap.c +++ b/drivers/dma-buf/heaps/system_heap.c @@ -434,10 +434,8 @@ static int system_heap_create(void) exp_info.priv = NULL; sys_heap = dma_heap_add(&exp_info); - if (IS_ERR(sys_heap)) - return PTR_ERR(sys_heap); - return 0; + return PTR_ERR_OR_ZERO(sys_heap); } module_init(system_heap_create); MODULE_LICENSE("GPL v2"); -- 2.7.4