Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3258465rwb; Mon, 15 Aug 2022 22:31:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR4T67aZEB2pFhaSfElzNh4WYdSaLS4UjhwEb2vkY7OYAgS8sXZm/saXUNf6X3I4zE+7jWZl X-Received: by 2002:a17:902:c102:b0:16e:f2ab:985d with SMTP id 2-20020a170902c10200b0016ef2ab985dmr20633931pli.71.1660627907863; Mon, 15 Aug 2022 22:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660627907; cv=none; d=google.com; s=arc-20160816; b=GB5gsrhMBxBsnclS56I4FwxhcohYWCiuv5aVSExcYtOwGBPuIssQwIIyVdBuOJWBPA F04nh8uJC54zrFvEcCnzJTAiIU6gKMCuqnCUEhGjfhHyAzqIjoLqF6UOTfYro8j1OYNu yKUw6HcQTN5d/kE/rR37EMCSam8XUabob7f+mWbU2ZVoVqpsrevfE34be/WcAojDmHTu 7ifWQjNU+8PWLC2YJTQOWhc5HUGXjn9gkFy8R1u7NxX6A1AoFcppkXKEyaa7XodOjGlT +JE4IxAMmv5RwzKFpNYWOs8SBcLSJisu/I4PzWTNlZKw2gVvgjidcZxwQuGjeCJMsfzP rf+Q== 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=PbUVTRmWW8R6e/3fiyvbtKJsQW93laWpBf/4wJQJJa3mE0y2yRRzeQr1Nw+96uKybB KnlxJpSRuFzUrD+k2kEv/Pvfp7WM/vVKOXKZOPYoneTt/e1PVKyvJybvTKrIbHnYpvst LhUDlKhfn7VUnvjZWYH2yffmJQCGEvcDEwR+PnwWNYpLk4jOY8l0liFMteuT5+yyWeZK cD1FGmcXIBc+qxHDBLee45C3+fyKu813a1cF+zlBSaeXVg/aMy5Zad4yhye8OZo1Ko+S +U6o9sAPr4qM1HrEwpNhmRnQFvKmaHYCqxKB0/lO5WOfrVxnBIezO08q6cBvtllHz9GJ iJdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Seeuo0RR; 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 u19-20020a63df13000000b0041f12e5fc3asi12784178pgg.438.2022.08.15.22.31.37; Mon, 15 Aug 2022 22:31:47 -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=Seeuo0RR; 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 S230186AbiHPEcv (ORCPT + 99 others); Tue, 16 Aug 2022 00:32:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbiHPEcJ (ORCPT ); Tue, 16 Aug 2022 00:32:09 -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 C83964B0C7; Mon, 15 Aug 2022 13:22:22 -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 6196EB8119B; Mon, 15 Aug 2022 20:22:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A214C43149; Mon, 15 Aug 2022 20:22:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594940; bh=k7nHqZv4WUM/Gzvi9+9Lkzl3Yklu7UNR2pB54Dnes3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Seeuo0RRZOrMfMh1y/FzyslACsU0FW9frW9NXP/tjYqsTqp4LHthLrcG9NEEM8Iky WdPvqVfPqNWjlkC5M84hY4+putkMx6lmkYM0gHGYmC38XliqevM4F+oYEZB/9VRbt9 O+VhNzAF230l9+26o6ViEM0rBwQmDZv9gdIUV9rM= 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.19 0606/1157] fpga: altera-pr-ip: fix unsigned comparison with less than zero Date: Mon, 15 Aug 2022 19:59:22 +0200 Message-Id: <20220815180503.912705347@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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