Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1885511rwb; Fri, 19 Aug 2022 11:03:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR5eXJOOAz3TTm+nB5CepSyqi7GibH3jCKDDYtFCZzdakNrmQ35s8ssEGYghm8wjUhTu+zQo X-Received: by 2002:a17:90b:4c4b:b0:1f4:d176:aa5a with SMTP id np11-20020a17090b4c4b00b001f4d176aa5amr9641754pjb.233.1660932215167; Fri, 19 Aug 2022 11:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660932215; cv=none; d=google.com; s=arc-20160816; b=L9hQz1QAIR/R7jXVpzCt4P2o/T782R8VYAyVfc363NWKSX3/wZdNB8rHfHfhkPYnzW 1RSUfyEzKgJnGkoMeyY7zLeaoNCjXJUrn6LRUPCwMRQVxFw++QbCaK6UQdJua8iAujxS ZTxpbuf+y7AYQ9V8aDmc07mzfyG/+FNAZmp92vz/rKDKyBrSajGPEuFEnTBjgOWC9oQ5 3hgE6aJE1snw/VY3mcIS+0hVqSHt7tE1tgTxLq+mF6yguvOv6GUjSdclefbQ5Sr8qa+N 2WOKguUZQoyDkcfENt3EbVa5GaIoXier9TPbzqN9vyqDlqN8QjoAaOiQBRttsrX7daAl 0bGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yVpL+S8fZROtTGjTgZUf0mYKCtxQaRN/RPI0Ou0tazc=; b=FtY67gM8EWKR8t4Vr49KZVa7o7koMMWVaJRZ/LhM1534c+jOI4GvVo6Xmx3/gSGI4J eJVNQLc/03/uDwQVLLBuPbN5P3CrnEeUVjnbb5ZjUP/KFKuJul4ar5hWIifiGa680VNv N5YaxjCw8jJAlh6hBtpduL0Lizfn450rYk7LdGAFnrB8T028KJ+aIVWCSWbKYyQQy69P TzjfBZUY78mCg8rtW9hSLbmbRqwaTdwDg8qqcWKdV818br/xPcb6KfhBnlccUC8+TM4G a8PitLfb3f/h6ZzzFMc3J/xHyfkUH2kf1Xk8ympgejbEqzXzOfpHVHrneCUldgaxBC/d CGhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="j5SqKM/4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h12-20020a65404c000000b0041d131e1594si4722695pgp.670.2022.08.19.11.03.23; Fri, 19 Aug 2022 11:03:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="j5SqKM/4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352259AbiHSQVe (ORCPT + 99 others); Fri, 19 Aug 2022 12:21:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352451AbiHSQQl (ORCPT ); Fri, 19 Aug 2022 12:16:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58435116ECA; Fri, 19 Aug 2022 09:00:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4B67DB82814; Fri, 19 Aug 2022 15:59:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A71BAC433D6; Fri, 19 Aug 2022 15:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924797; bh=YdPA2pUsmy1j4WukL3ftC+x/O9+nLCAZcpceB+7WrAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j5SqKM/45JS5PWFbygA9vPWeauYpkhrnABZWiEfIyPtKtM/IKwujcXwUfIIdSo/fh ZiED/g86ai54L1VUVEOXWWJFLSyiD9ju8/LjyUzLClXzJnIfg9eSfIBPnD/tCzcyGX ClFsmORu72A/syw4bUkeNWOvG2CPY+xp5dkzjvNI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Rix , Xu Yilun , Marco Pagani , Sasha Levin Subject: [PATCH 5.10 278/545] fpga: altera-pr-ip: fix unsigned comparison with less than zero Date: Fri, 19 Aug 2022 17:40:48 +0200 Message-Id: <20220819153841.759220471@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: Marco Pagani [ Upstream commit 2df84a757d87fd62869fc401119d429735377ec5 ] Fix the "comparison with less than zero" warning reported by cppcheck for the unsigned (size_t) parameter count of the alt_pr_fpga_write() function. Fixes: d201cc17a8a3 ("fpga pr ip: Core driver support for Altera Partial Reconfiguration IP") Reviewed-by: Tom Rix Acked-by: Xu Yilun Signed-off-by: Marco Pagani Link: https://lore.kernel.org/r/20220609140520.42662-1-marpagan@redhat.com Signed-off-by: Xu Yilun Signed-off-by: Sasha Levin --- drivers/fpga/altera-pr-ip-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fpga/altera-pr-ip-core.c b/drivers/fpga/altera-pr-ip-core.c index 2cf25fd5e897..75b4b3ec933a 100644 --- a/drivers/fpga/altera-pr-ip-core.c +++ b/drivers/fpga/altera-pr-ip-core.c @@ -108,7 +108,7 @@ static int alt_pr_fpga_write(struct fpga_manager *mgr, const char *buf, u32 *buffer_32 = (u32 *)buf; size_t i = 0; - if (count <= 0) + if (!count) return -EINVAL; /* Write out the complete 32-bit chunks */ -- 2.35.1