From patchwork Tue Feb 8 20:41:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 12739296 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C58E5C433FE for ; Tue, 8 Feb 2022 20:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=2AGuvQapNQuMlfJ5zqx3pmyjjdduw+MK4U+DetIxrEA=; b=gVMu97b9AlxEL4 pRlufodBStkyhItN3yPIfGjGMQ9V9kOv/MCh0FTJqxMt6ogziTjN971e65Z021HxEng+WbcVgOjfN xrcSK7Ob3DhVWOMHLfyQGlfae0h/OCXBO4W2eePMcynheyOVDFzHjujcMlK763VhtnA5xledIlBgs gMTpgT/pJ3OFgd73nzxfIxnJipHVXH1C8OhcRe+Eo847SLqeI0mioXJUynoUAbudaVRfbbDQaIUBH zIp8UMBTeZNcj2K1b8a1q/5YyKicymsgm0u+luXHWGkNqps6nSppMuEIUAxq3nxbLdH/FAUBM/fX8 TNQ9DKooMSp0iw0W8qmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHXJ9-00FWAW-9Q; Tue, 08 Feb 2022 20:41:51 +0000 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHXJ4-00FW9x-KP for linux-arm-kernel@lists.infradead.org; Tue, 08 Feb 2022 20:41:48 +0000 X-IronPort-AV: E=Sophos;i="5.88,353,1635199200"; d="scan'208";a="20362514" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2022 21:41:40 +0100 Date: Tue, 8 Feb 2022 21:41:39 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Wendy Liang , Michal Simek , Ohad Ben-Cohen , Bjorn Andersson , Mathieu Poirier cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] remoteproc: fix minmax.cocci warnings Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220208_124146_983357_65A3EF3A X-CRM114-Status: UNSURE ( 8.46 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: kernel test robot The code seems more readable with min. Generated by: scripts/coccinelle/misc/minmax.cocci Fixes: 2b9408d09dc6 ("remoteproc: Add support for peek from remote and acking kick from remote") CC: Wendy Liang Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall --- tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15 head: 1183ce490adb103e5e569b8ebd74c50c885ddc05 commit: 2b9408d09dc6367fd2f0820f0c7beab69e9aed56 [550/872] remoteproc: Add support for peek from remote and acking kick from remote :::::: branch date: 7 days ago :::::: commit date: 7 days ago remoteproc_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/remoteproc/remoteproc_sysfs.c +++ b/drivers/remoteproc/remoteproc_sysfs.c @@ -241,7 +241,7 @@ static ssize_t kick_store(struct device size_t cpy_len; (void)attr; - cpy_len = count <= sizeof(id) ? count : sizeof(id); + cpy_len = min(count, sizeof(id)); memcpy((char *)(&id), buf, cpy_len); if (rproc->ops->kick)