Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp1521694rwj; Sun, 18 Dec 2022 09:47:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXsi81DiTv9n+ieg7gAcjR0ZTJA2WRVljdOwDH1lidqG2mIUG8gg/AYDj+NgUXk7pDHUzVk7 X-Received: by 2002:a17:902:f112:b0:191:386:d8f with SMTP id e18-20020a170902f11200b0019103860d8fmr9552575plb.47.1671385626008; Sun, 18 Dec 2022 09:47:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671385625; cv=none; d=google.com; s=arc-20160816; b=LyVqbnn09RN4mfHFKODgstJdEXigUeHXvUoPtyWFXt8/5Zqv1D2gEhDPQKRAXcAJkN m8UVcA6xHIe+hiVM8M2WtPmYMNSWdMqoqJqfU5O+SaGbYU5I3unH6DblQplyzd+9kbnH ObDB8C+UlhpT7qrxqEgTeg+H4wpg/iorEuF/kXmhouB3XhQnVWVQHLn2OTuiGOzysiCu q6dL5zPFB6QM+ryrL6VGAzneCb5XFoEfUtyjq3YD7rJAxymU0XYLrAHxoY5mmudzlw/j Ve2wr9DIQPPwddydRmumBGzbCM3bsomB2z5RaCGblBhYmmEM+yqnUzC/JkyYX3F0tbW4 Y3mQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YBxGhNyaTqfcP7U28Ykw0iRBnX8QVwmA8CB0YKaB+W0=; b=MCVi5mCskH1xPxHpTf8uHf3RmPf3K0u/mtIu5J8RNziu1N2SZ8MTKq9Q8eCwEzpnQx blpLyw3L/KCrsZ0I4JARIrBaLTk6bAliHwWJLRQasMxJDhX6b/5zTfR+iDaxurAIe1yk RFX7Dj8gO6FecfjGWXBjs3f2xp/hTa8hJ1HGtCgtOz/2OzXbPLQ8tQDlSrI9ga1urE0L pGZuMVYjbuRkPA9nJbN6SNnrZAtyUyFmhHWTWscn2MTzcFazcfrZIEQQnvjW+C/ZB6yY hSbJGqoTWAJqZDrMAh1laqTVLC/L+t8rIKYnBhsPYDadEcWCva94IW6/FNTSC7WLf/Rb knxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HtPvPc1E; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg2-20020a17090326c200b0018981449921si7826195plb.107.2022.12.18.09.46.57; Sun, 18 Dec 2022 09:47:05 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=HtPvPc1E; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232484AbiLRQia (ORCPT + 70 others); Sun, 18 Dec 2022 11:38:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232559AbiLRQhb (ORCPT ); Sun, 18 Dec 2022 11:37:31 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8820817ABE; Sun, 18 Dec 2022 08:13:30 -0800 (PST) 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 4AD4CB80BAA; Sun, 18 Dec 2022 16:13:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6858C433F2; Sun, 18 Dec 2022 16:13:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671380007; bh=+UFLAKJJOA/uFVS91WfsFbeGcoJcsffpJo9xiySLz1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HtPvPc1En3aQhGVNeykr5cEW7A4TeldCQCaoJI946wCPM7K1/cnemrvvpdSkiilXx cKneV11vpvrfq5EfOOPD7fujJC2ksjpn5wgUaFuOt7vKvZ+NzM1Ao7UV1I7cmD8LaG gtgTpSuZl8baW1kTOhqJ8uoVQTjgOPhmILh+jXlToov6N67oS5KgrPfEG8vNpcWSeV ErSodVH2emnMVnwV31gZeG1zHmmiKrOi7phLkGfm4w2++zoU7y4ErWitzp8f79gpnT yp2fjVPRg2leagbstzEEVC+bFYNGByoq4CV35PXXdB0C/EVrZ3HzLhdbVn4Dl3huJs F7FrVNXPAcsQw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Jiri Slaby (SUSE)" , Martin Liska , Ariel Elior , Manish Chopra , Jakub Kicinski , Sasha Levin , davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 10/46] qed (gcc13): use u16 for fid to be big enough Date: Sun, 18 Dec 2022 11:12:08 -0500 Message-Id: <20221218161244.930785-10-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221218161244.930785-1-sashal@kernel.org> References: <20221218161244.930785-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 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: "Jiri Slaby (SUSE)" [ Upstream commit 7d84118229bf7f7290438c85caa8e49de52d50c1 ] gcc 13 correctly reports overflow in qed_grc_dump_addr_range(): In file included from drivers/net/ethernet/qlogic/qed/qed.h:23, from drivers/net/ethernet/qlogic/qed/qed_debug.c:10: drivers/net/ethernet/qlogic/qed/qed_debug.c: In function 'qed_grc_dump_addr_range': include/linux/qed/qed_if.h:1217:9: error: overflow in conversion from 'int' to 'u8' {aka 'unsigned char'} changes value from '(int)vf_id << 8 | 128' to '128' [-Werror=overflow] We do: u8 fid; ... fid = vf_id << 8 | 128; Since fid is 16bit (and the stored value above too), fid should be u16, not u8. Fix that. Cc: Martin Liska Cc: Ariel Elior Cc: Manish Chopra Signed-off-by: Jiri Slaby (SUSE) Link: https://lore.kernel.org/r/20221031114354.10398-1-jirislaby@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qed/qed_debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_debug.c b/drivers/net/ethernet/qlogic/qed/qed_debug.c index 6ab3e60d4928..4b4077cf2d26 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_debug.c +++ b/drivers/net/ethernet/qlogic/qed/qed_debug.c @@ -1796,9 +1796,10 @@ static u32 qed_grc_dump_addr_range(struct qed_hwfn *p_hwfn, u8 split_id) { struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; - u8 port_id = 0, pf_id = 0, vf_id = 0, fid = 0; + u8 port_id = 0, pf_id = 0, vf_id = 0; bool read_using_dmae = false; u32 thresh; + u16 fid; if (!dump) return len; -- 2.35.1