Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3022845rwb; Mon, 15 Aug 2022 16:20:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR5DQ3fWnh4re0NbwtaTmz+mlUGrULsRRujrnY80EtlEERtd1Iigao7Uuk4Ae6iBOn4USYtA X-Received: by 2002:aa7:9813:0:b0:52d:395d:c98d with SMTP id e19-20020aa79813000000b0052d395dc98dmr18389462pfl.55.1660605619732; Mon, 15 Aug 2022 16:20:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605619; cv=none; d=google.com; s=arc-20160816; b=J3/JRFHHFleox4Khn2iHpO9tmhgfchHJ9vRTpu2ix8M92pot6SHcibbumvPajJiHyS FnRukHD+G6XwFraHcSC698l8SXFX1N+DU1xp0lSwFs1czXtACdjcwQmnxv9kvi0YC1QJ dj1DUQi4ossqZ+jl1mnLdcB0a76Y8t9zQezAn09U8gu8CkwyKwz8zGJ2Wa/polq6QaKP W6/0CdJJ+tckCK9dm2qpy7wWzcCtu1CrdSD3bHiSBHQzrvfBkSQjAviniun1ixQ6esz0 Hj1h8YC31/dAMVAf08CrgNGBMdxR629T32pEqn67PSr/6DkaffUhEMZLG701UQ936mvn BDeQ== 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=KRKQJDMY0NKZKP71sigiyuqQ+7nryLWiPpa4e4H0C0Y=; b=ITYHbtcH8LjccsXaDF3sOjARKaSV4BUBKacMsxYrbjQPXRl0DP6tgfDREg7U52d22m rtPDYE4tx8lAVo33A+aLisX4Z0HdUTmAvjB7iINVM1TxXzBTaJUHsptOy0bCbnfSgkzq P9xGWzMH+jcPkg9dAKiGfNjLsbwXk6qUwOL6KXhnQw2R9pGn6shGtROEB09/AhhH7tPu b3wEOR8QCEAEYavCFaGFY2fezPVgk1dJ/xbCYDxpzBl9mqw3FIBLZJ58mu1M2bF4SYqY nB9qngZfCSzUg0Rhpmqgif2pAusCw9MHESItbw0ldUsVUcD+e9cFqzkcJPNIUX+WL3Tl xcBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q8l2wOn4; 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 84-20020a621757000000b0052ac8eee909si10196288pfx.300.2022.08.15.16.20.08; Mon, 15 Aug 2022 16:20:19 -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=Q8l2wOn4; 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 S1346972AbiHOVcN (ORCPT + 99 others); Mon, 15 Aug 2022 17:32:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348462AbiHOV1n (ORCPT ); Mon, 15 Aug 2022 17:27:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16831EA8B9; Mon, 15 Aug 2022 12:23:28 -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 82868B81128; Mon, 15 Aug 2022 19:23:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0284C433C1; Mon, 15 Aug 2022 19:23:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591405; bh=k7nHqZv4WUM/Gzvi9+9Lkzl3Yklu7UNR2pB54Dnes3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q8l2wOn4yIIzEAY8UtN2PqQbC7OetImMlwMkdAj73A7F6ntk8ta5E3yh+vuROUxY9 ID4jaT5UrqfPwN/a1M0/sBnTh834A6KkwB4ypSab5EbKbDvhHF5atdDLWBa2OwXOiZ s4a6M70h00fU00k7NG2o2o+y6lU1ZYpG40BMuOwU= 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.18 0568/1095] fpga: altera-pr-ip: fix unsigned comparison with less than zero Date: Mon, 15 Aug 2022 19:59:27 +0200 Message-Id: <20220815180453.069129334@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 be0667968d33..df8671af4a92 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