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: 12739442 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 0AA61C4332F for ; Tue, 8 Feb 2022 22:26:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386443AbiBHWZr (ORCPT ); Tue, 8 Feb 2022 17:25:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386500AbiBHUmt (ORCPT ); Tue, 8 Feb 2022 15:42:49 -0500 X-Greylist: delayed 63 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 08 Feb 2022 12:42:47 PST Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BC4DC0613CB for ; Tue, 8 Feb 2022 12:42:46 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.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)