Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3456265rwa; Tue, 23 Aug 2022 05:11:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Yi+Ub1oMMj5xqypqIAnUf8HF9xbA6xvTmMkKhKtNwgueUe3xTty8g9PWRAjeM50qZn99P X-Received: by 2002:a05:6402:190d:b0:446:871c:b536 with SMTP id e13-20020a056402190d00b00446871cb536mr3619035edz.175.1661256718766; Tue, 23 Aug 2022 05:11:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661256718; cv=none; d=google.com; s=arc-20160816; b=j5p8wSwtmvrEYO9IiNITiy9tP+/gkuoee440mx8281uXJxjAqcpOw1tPxA5GbKg2pc bqf+WIDqIRl7dsbVHoGejOvQtcucu8jVcShbxk0buGHTL7E/mp/TwKZRm9m9CshEVxAx m2ELP++zNT3vYs2t60Xmurn++P2+XU4QLXvgtoPKhUk8qjI7mQbsigLAZuljr0fuqKlt +8iO4RIw41b6IZHeat2Q+HN+GE8Bb4sodp3yJngf/b0zJ2D+q8EgKBsu+ax8VgaULO+T oujagU0hooPwz9l1Lpiufucp5uBvhGcdh/i4T8fWRUQQAforAkQ/6ZnIRw56V/Kcx9/6 /zCA== 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=mFRQQ3t2oL1TdjVML7Q/qx2ZvSJ6Ry35/9Jh0q1CtXM=; b=em3alN9t0wELPHkK4KslSuXAaxsyV0xAj7bBLi7p50nA2jajMf04dvkCiVgyz+Kpyg /ZGVhnvD1E9j218tcyrfPtChWVB+YqCrhSDvTsv2rSOMpTuXOhk68ML06GpXWq+Aiu8k idzgq5bA9/EWU+Qq5/8Zpas+H/bHuYtYQ72eJYYfrEEgj9TRJr11mB4xnIZrM2A1WUaw E+20FirAaUq06gwEZlZpKbbHpWPDqDigr9ud/4KxpL8ZZ92EpY/kS5Jyoc7PKnO/gH3q 3rv6mfTjZc3NhhLU/th97R+9pY/XGuQBCyzLNzW9p0ijUvOIJaKRrIsFq574TZZ1BMkI C1WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=puIq5+28; 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 g11-20020a1709065d0b00b007385dfb42c7si7029040ejt.565.2022.08.23.05.11.31; Tue, 23 Aug 2022 05:11:58 -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=puIq5+28; 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 S241749AbiHWJxr (ORCPT + 99 others); Tue, 23 Aug 2022 05:53:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352176AbiHWJvV (ORCPT ); Tue, 23 Aug 2022 05:51:21 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 083339E2FA; Tue, 23 Aug 2022 01:45:46 -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 1C31BB81C55; Tue, 23 Aug 2022 08:45:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60ED3C433D6; Tue, 23 Aug 2022 08:44:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244298; bh=7hdHv7J+04cx/G4tWWXZvkrtgK+459IewjPVceZKJkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=puIq5+28ClpO65DHH/ruvepgtorxPgvG4f5dfd14hZF8/3jQqNVMv4EvVMbLpDPXM 3LgmqxQWSPEsY9CjQZLVchf/YbdAk8DnP/khCptkWUqCAfg4xqv4i3RQfS0DUEr2sF jR3fwqXLtMebpoasqv0utP7hxqIvao2xria8lESA= 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 4.14 098/229] fpga: altera-pr-ip: fix unsigned comparison with less than zero Date: Tue, 23 Aug 2022 10:24:19 +0200 Message-Id: <20220823080057.196214331@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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 a7b31f9797ce..0314737d705b 100644 --- a/drivers/fpga/altera-pr-ip-core.c +++ b/drivers/fpga/altera-pr-ip-core.c @@ -119,7 +119,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