From mboxrd@z Thu Jan 1 00:00:00 1970 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 DE2E8C433F5 for ; Thu, 10 Feb 2022 18:00:10 +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:In-Reply-To:MIME-Version:References: 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: List-Owner; bh=KSvuxOnC0Nl3hV8u1ufYAzwmbx2uMQFXAXjJkRN6nvo=; b=QvQNM9Jz4z2QAv JQz4z3hFovhFd4CGtx8iyjKpP5JGyixz1uFPUrgvsjFYOj/NnRnX7qsU5UajvLPD2+IX4iWqEh+2y eOL0GeZtHDVhatHkQx4lMuX0NWNPobzw4146HwF6l9FklwDNHYbTgXysrp2RUwRgctkKxO4Nt7aoa 02pK4fSJGD5MRPO0oC8lWVbSGwaEtrTHm3hGACYChobhZ70pmYu3E8PHeAN/kWZJKuSuzMKvuOwnR ROE6OiQsb7dvfB9nbG/4UzKzUNpCcxMnluNbgjH1rbKHhdEDLR7OPEnBha7QX/S5CiNKhpTE5m5yb eR3G8ythf5Wpu7GRFCdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nIDia-004YwE-Ey; Thu, 10 Feb 2022 17:58:56 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nIDiX-004Yvc-0B for linux-arm-kernel@lists.infradead.org; Thu, 10 Feb 2022 17:58:54 +0000 Received: by mail-pj1-x102f.google.com with SMTP id v13-20020a17090ac90d00b001b87bc106bdso9321043pjt.4 for ; Thu, 10 Feb 2022 09:58:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=eJjpjiZFmC3NVaxARYWkgFsjJKrhv1BAcceimkRM1uc=; b=I4hwIxjkkeAi4jIAR7EXdb4NWii/7oxAC6AKqPuQcnGc8TW/3D7Kxhqam1lyFsXflt Vm5HJqIQnwHvwhbzNaVZa/mGzfaowJ3SBRqQD0pO7VdYw06AMqhgorMLoVu687YW6uRy xkDO6nKGEP1GdnvBreXiy7Bzs/r8JG5ZY52itSe+2nWNR7aR/w54AI9EhT004OHlxO41 Zue5nM3Rjk/3mHOTvwbP6nVoO7O6C5tofS/BRIFKSU4np+suf7OKHgu8N9LUfARepCSh PX2O6hjyeqrkf2K0IX6MAgjAOqbTm0uSfwncU7ax0gdaHn259R4/6H92h5F65UBFMXJT ESLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=eJjpjiZFmC3NVaxARYWkgFsjJKrhv1BAcceimkRM1uc=; b=jfrGTxnh+PA0S+YV8x2BNA8MSP7LXfHCkEOoOST7bX/gEYLFU+XtlN80oeijnu0gju 9L8+15f1P/QcuA7ndQrqnwDN2ELHg+Dhrv501ieSMdHLyi7i4RVrHhSdYpCjXk79HSn2 8ce6ZxlPllGvkY8vgCfPMFz5SZUXLFcStPHxXKa7Yn56xNpRI8vZcphOgZeRP9laPcGU pTB4dNuUe3ftkLTZfNdFQkjsT1X1lixbbHt8GGNZc/WKUdpyy5C1JJlJldhQEdBowZJT zL3+socFs3+tk1x/f+Byx8O4adtyJecKVWqEPK1gnwyu09xt4nIwOFyVgui2Purmxb1L HPwg== X-Gm-Message-State: AOAM530W86J1Ao4MOsQENYu0S1DijEiqpQElco79xNKasgW3DUo/y7ub CXF/cT+8hOHv43Riw7wY7WR4/6JciZE1GQ== X-Google-Smtp-Source: ABdhPJybX2DTRur/fqp1T3fsi1sv7jdOfBkzRKrTiFCl1wtzaexEErRObkoG10fCF7lKUo/ZB94mrw== X-Received: by 2002:a17:902:db01:: with SMTP id m1mr8805397plx.53.1644515931043; Thu, 10 Feb 2022 09:58:51 -0800 (PST) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id y30sm3834969pfq.142.2022.02.10.09.58.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 09:58:49 -0800 (PST) Date: Thu, 10 Feb 2022 10:58:47 -0700 From: Mathieu Poirier To: Julia Lawall Cc: Wendy Liang , Michal Simek , Ohad Ben-Cohen , Bjorn Andersson , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] remoteproc: fix minmax.cocci warnings Message-ID: <20220210175847.GA3603040@p14s> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220210_095853_069299_26715DEB X-CRM114-Status: GOOD ( 17.19 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Tue, Feb 08, 2022 at 09:41:39PM +0100, Julia Lawall wrote: > 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)); Looking at the min() macro the above would become "count < sizeof(id)" rather than "count <= sizeof(id)". I don't have more context into this code because I can't find it in rproc-next nor today's linux-next, but it is something to look into. The patch is also missing the minmax.h include for the min() macro. Thanks, Mathieu > memcpy((char *)(&id), buf, cpy_len); > > if (rproc->ops->kick) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel