From patchwork Fri Feb 25 08:00:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: baihaowen X-Patchwork-Id: 12759827 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00AD6C433F5 for ; Fri, 25 Feb 2022 08:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229674AbiBYICO (ORCPT ); Fri, 25 Feb 2022 03:02:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238335AbiBYICN (ORCPT ); Fri, 25 Feb 2022 03:02:13 -0500 X-Greylist: delayed 62 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 25 Feb 2022 00:01:39 PST Received: from mail.meizu.com (unknown [14.29.68.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97527DF1B; Fri, 25 Feb 2022 00:01:39 -0800 (PST) Received: from IT-EXMB-1-125.meizu.com (172.16.1.125) by mz-mail04.meizu.com (172.16.1.16) with Microsoft SMTP Server (TLS) id 14.3.487.0; Fri, 25 Feb 2022 16:00:37 +0800 Received: from meizu.meizu.com (172.16.137.70) by IT-EXMB-1-125.meizu.com (172.16.1.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Fri, 25 Feb 2022 16:00:35 +0800 From: Haowen Bai To: , CC: , , "Haowen Bai" Subject: [PATCH] soc: qcom: qmi: Use min() instead of doing it manually Date: Fri, 25 Feb 2022 16:00:31 +0800 Message-ID: <1645776031-13516-1-git-send-email-baihaowen@meizu.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [172.16.137.70] X-ClientProxiedBy: IT-EXMB-1-124.meizu.com (172.16.1.124) To IT-EXMB-1-125.meizu.com (172.16.1.125) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Fix following coccicheck warning: drivers/soc/qcom/qmi_interface.c:773:12-13: WARNING opportunity for min() Signed-off-by: Haowen Bai --- drivers/soc/qcom/qmi_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/qcom/qmi_interface.c b/drivers/soc/qcom/qmi_interface.c index c8c4c73..3337a70 100644 --- a/drivers/soc/qcom/qmi_interface.c +++ b/drivers/soc/qcom/qmi_interface.c @@ -770,7 +770,7 @@ static ssize_t qmi_send_message(struct qmi_handle *qmi, kfree(msg); - return ret < 0 ? ret : 0; + return min(ret, 0); } /**