Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3086057pxj; Mon, 7 Jun 2021 01:44:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxA9qS1RxI8N4+3IH+hTFSNFxBoZP1fCH2QPlTeNaGJ0m/CYZzznTUcj9j5i/WONYkIfW1y X-Received: by 2002:a17:906:2419:: with SMTP id z25mr17059334eja.343.1623055476551; Mon, 07 Jun 2021 01:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623055476; cv=none; d=google.com; s=arc-20160816; b=C7aVLD2wR9CJVrVIYjrdGqU+fgrC0sqiGy7H+nZ16msyNW/3SPdnH9071idgIBESUZ /69MNNbYT+/uG+94UruGlDylSGKCWvsa9aRhe4m+VDBeaAju9wI2SgIWtv0qUuwrlEbD 9YqQZ0YkxtecLmgTDt2TauqWWtY9Ga0awQz7JqTozebez9MgjBbmes7JG7nc5W9ukUXd n0KPv3nDVb3dgFzB0MbPQObb2VQM52iZ3h5Io5GmoOOYkwtGW/T6zitzfS2rfWZJUCHG XWjod1a64+Hh3Prkb1Fg/8OZevROx7dR0cKA3gwH5hR2yrWJ7ZZI5G5CG1ZzP1M2NdLL 0+Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=3agjlmS/4/QCBFAH0VR8xlPJmX7QeJESrfPnf5h3xUI=; b=Eo0zuCwqOGfrdetK3aFLv1dlWtRMSPqb4ThtFNg+TRVKSvoseJQmkERzXcvoS/j88X A+1MT3pb5/C6OLxXapXMsR1n2+dS1nWzCEh9WhX98pb3WgRl8MJBYGNMRRDrYsUVQ7gC wxSu/0PqAxKXe9AX0SlsDFnIjd2M6uMT8OtnHePOEceQOgRJhte3Am6E1lPHyhHVoqRv Q9gC8+cRaV+JY2DDfipPkwMGAXszhZI7Ny/8bx8zl8Fp8roocnvVjfETyWdrb5L+3WZC M0XvBqAo0P+44d+pDJXxacHVHOFOJNNDHIEji5EveeNDPDDOM/rsVNVZpDlCSm7VKaxm zL0g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c16si12532879edw.128.2021.06.07.01.44.13; Mon, 07 Jun 2021 01:44:36 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230267AbhFGImf (ORCPT + 99 others); Mon, 7 Jun 2021 04:42:35 -0400 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:42717 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230262AbhFGImf (ORCPT ); Mon, 7 Jun 2021 04:42:35 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0UbaGA5H_1623055241; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UbaGA5H_1623055241) by smtp.aliyun-inc.com(127.0.0.1); Mon, 07 Jun 2021 16:40:42 +0800 From: Yang Li To: jdmason@kudzu.us Cc: dave.jiang@intel.com, allenbh@gmail.com, fancer.lancer@gmail.com, linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH v2] NTB: perf: Fix an error code in perf_setup_inbuf() Date: Mon, 7 Jun 2021 16:40:36 +0800 Message-Id: <1623055236-97905-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the function IS_ALIGNED() returns false, the value of ret is 0. So, we set ret to -EINVAL to indicate this error. Clean up smatch warning: drivers/ntb/test/ntb_perf.c:602 perf_setup_inbuf() warn: missing error code 'ret'. Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: Serge Semin --- Change in v2: --According to Serge's suggestion, set ret to -EINVAL. https://lore.kernel.org/lkml/20210605180554.ql4rhpukj57ujkxw@mobilestation/ drivers/ntb/test/ntb_perf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c index 89df135..65e1e5c 100644 --- a/drivers/ntb/test/ntb_perf.c +++ b/drivers/ntb/test/ntb_perf.c @@ -598,6 +598,7 @@ static int perf_setup_inbuf(struct perf_peer *peer) return -ENOMEM; } if (!IS_ALIGNED(peer->inbuf_xlat, xlat_align)) { + ret = -EINVAL; dev_err(&perf->ntb->dev, "Unaligned inbuf allocated\n"); goto err_free_inbuf; } -- 1.8.3.1