Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1779407pxb; Wed, 9 Feb 2022 04:26:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6Miki3pbDXegGaitncpnujNlHxWFvZWQCVnnydqxbg2uh6U+VYN0Kq0FDKrWQd9d8tex7 X-Received: by 2002:a05:6a00:984:: with SMTP id u4mr2016214pfg.67.1644409601703; Wed, 09 Feb 2022 04:26:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644409601; cv=none; d=google.com; s=arc-20160816; b=DboAkIRAkt3bKiMgfUWL6lulFFCjBFHPMKneJP0kppN/HsAAcOGvhUEUo/7a2t0sFh 2IgmHtgstUwSHqS7l8KVyzWn5JFozhG7+Y6WS48DAJ07glom+qxQlQcy7MH41ARGBiin lAgdKwUr0/fJHqcCu45LWqU2RponDO60fIyhYL+D3Sia4QhSOU/qyGSXwMqgkBxjvioa quHHzgyK0VSXCo9d/ZMGyGSLbMlwraVvBKAlVm5BuCFURbSiF7Yse470wUfGFVw4ot+3 Z4vrcsjqK6eYnXdZnIMWrPc/DBuJlONVOR9JljPJrkHt5wubLo5gYGk/YQT8uSfYEiYU eYDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:subject:cc:to :from:date; bh=MHhNzgkGKEZ2CxACCmkjZplWHbU9cyaQ8AO2NtlCP88=; b=Wt7l5B/EOHGekJ8PKHIzAYSim3NPoSp0p9o5k/TVa/nA1toIVo71RHQUAvVFI36XPx jhVSggsZ+2wrpTksUq1YZ0cuzJqxf0TAW53VBbpUtxJGi71hEIo1rXO8eCDIBUbhXl+J Y7Em3n/tpF13tSZKkDsjLpFwadK1D99gLJb17QExg/SJuFym2tPjF8C/+9Cdk8R4+I2e +ymeFotL3YOaw9ApCJmVW+pJjVt1jWrAEk6aHZfW2BWlMZ+J2KBZ5urzYRPWx7+QwkCi g16SxgRA9YAS741OyHvmRF2J972RsOWRtOWDqT1YbqcuOgznRqtecBz1/5UJjzBxiVWw R7kQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bg5si14891503pgb.708.2022.02.09.04.26.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 04:26:41 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0CF8FE1295C6; Wed, 9 Feb 2022 02:18:03 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387494AbiBHW2M (ORCPT + 99 others); Tue, 8 Feb 2022 17:28:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386489AbiBHUlq (ORCPT ); Tue, 8 Feb 2022 15:41:46 -0500 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 DD170C0613CB for ; Tue, 8 Feb 2022 12:41:44 -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 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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)