From nobody Wed Apr 8 22:41:33 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64CF8FA3740 for ; Mon, 31 Oct 2022 11:44:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230366AbiJaLoZ (ORCPT ); Mon, 31 Oct 2022 07:44:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231157AbiJaLoJ (ORCPT ); Mon, 31 Oct 2022 07:44:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F176CEE0D; Mon, 31 Oct 2022 04:44: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 9FF72B815F3; Mon, 31 Oct 2022 11:43:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18A8BC433D6; Mon, 31 Oct 2022 11:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667216638; bh=ZKQMpX4qGKyQLBywqky+QWUckJGF7SXW7qUOTP5qfrs=; h=From:To:Cc:Subject:Date:From; b=in52tpEP7HlAbsUsm/FUBDmublUfP6UNxCimfAFIQtbBMo/aXKnzby5aC2qgVck8w +QcV2jPFnn5eivH2VvbOPHRTDvz854SAqDwKMy1WEAoZudHrkiGJh+9DiZnZfccUyk Rnvv5eziSyFNzZj9rBBnCGc/LelaQ8wiIwSZEuHCBQfB4v0cy2CLQ8kT3NDTiiFVcn QxU8VBqaAJBApB5TiB+rpY3m+b0omSCfntGtcHMIPEYuWfhZeV7f5PmZl6b/NLPx9W oBl42H+8kGM4s7CGVkKWrlYRGhlnttUgp433fPDJ7YPhMgpyLD01pBCzk8V7kjsyPo 72P2ACbchICpw== From: "Jiri Slaby (SUSE)" To: aelior@marvell.com Cc: linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Martin Liska , Manish Chopra , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: [PATCH] qed (gcc13): use u16 for fid to be big enough Date: Mon, 31 Oct 2022 12:43:54 +0100 Message-Id: <20221031114354.10398-1-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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' t= o '128' [-Werror=3Doverflow] We do: u8 fid; ... fid =3D 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 Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: netdev@vger.kernel.org Signed-off-by: Jiri Slaby (SUSE) --- 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/ethe= rnet/qlogic/qed/qed_debug.c index 5250d1d1e49c..86ecb080b153 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_debug.c +++ b/drivers/net/ethernet/qlogic/qed/qed_debug.c @@ -1972,9 +1972,10 @@ static u32 qed_grc_dump_addr_range(struct qed_hwfn *= p_hwfn, u8 split_id) { struct dbg_tools_data *dev_data =3D &p_hwfn->dbg_info; - u8 port_id =3D 0, pf_id =3D 0, vf_id =3D 0, fid =3D 0; + u8 port_id =3D 0, pf_id =3D 0, vf_id =3D 0; bool read_using_dmae =3D false; u32 thresh; + u16 fid; =20 if (!dump) return len; --=20 2.38.1