Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4057349rwb; Sun, 9 Oct 2022 17:01:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7lFe60eX85MhKFdC4mzjLbULCivX+TrbjD1SFyRgQoLewGdQJ+p0jGpJwbzUubx+xN5jdZ X-Received: by 2002:a17:902:d714:b0:17f:5813:1df4 with SMTP id w20-20020a170902d71400b0017f58131df4mr16954876ply.148.1665360089392; Sun, 09 Oct 2022 17:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665360089; cv=none; d=google.com; s=arc-20160816; b=fUcM/jSHAofy0kI9vyp7CD5GLxAGqwMvE/BwpWrDB/n8p1XSl386Z/G0T366hMbrpR GO0G6TbtXP2mA9XPRJun8EqDwCclLjCQEB21wG/hZniFJExHTjHKq0yB/akRBWqRaCKj bLN7ivnH/t0nlmvpXuszmxSIxVdM6GMSn9RP33tDuw9qDzFm0K+P1XfQ5rrjhmNpUkte 7GcZiWyrmmpzzxk3k3EGsnS8DgR+tB1eYS9HQ1hZhOuhrEDy1er5jOnDIuGop6nCpVZC lVZGiwScHBlqxkOTGHv2XCMv1tZmmDDx+CKS1HraWlY6+HwfMK0ox4moddd7vACfOlbR ODQQ== 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=iFfQjR1UVZEN9OVBqhn0SsAeBlvFeAmJ8ukpIyguQ4A=; b=VD/MgzCyOt7r1vHOjYUCy86ZrRfcUP4wWk5ae9rDgEzQ67aZ4FQLwo1kBg/blrFH2N a38bTd6+gnmucbfNaEVL53XJuH9NX+oazHv06fmtBFvYn2QUGid/Uz04T+XJ2A9VtFin 4o//DkIXyT9VL9CzeBQ1T0m/Rxg45zv65L5A0P5oqsIUZ71Cm8+qqVv72Adb5SwziVmK SfJksGbmkqo/nBq97QcPJdAXUHeajSWxLsoxJz9C+CHR9XOHNjPuqeWzMWUmbvCa1dqn xDb2IXR8XhJw37JavGlEZkwGKnCWJULt4JAXr+76m+BtU5BJoOybvIegSxJw+cq63y6N +3cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hIc2C110; 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 h66-20020a636c45000000b0042b807728e3si10518929pgc.762.2022.10.09.17.01.02; Sun, 09 Oct 2022 17:01:29 -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=@kernel.org header.s=k20201202 header.b=hIc2C110; 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 S231852AbiJIWZ4 (ORCPT + 99 others); Sun, 9 Oct 2022 18:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231845AbiJIWXt (ORCPT ); Sun, 9 Oct 2022 18:23:49 -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 0F0FA264B6; Sun, 9 Oct 2022 15:18:06 -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 AC47BB80DE9; Sun, 9 Oct 2022 22:14:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72710C433D6; Sun, 9 Oct 2022 22:14:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665353670; bh=vkat4yOAmBKTohHWR4IO8HDVyG+wngIzOyTOnf5NIBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hIc2C110Dsa+/OqOBW8CV9cpK/LaS6JwUIoWe4Ayv4hYMb9cTiH+wS7rd4mn8Vqai ARYBl3RnhXYpxw2143VGbE6L0SIoJm1DzbhjyIxkiMWhk7GG5mfPGyGFz8KNWueOwX ETnGd4CGFIQ0pdwN+3AtgYjEBEpobB0s3ZnQqrmMN+jjqED5TQxrO55e2GrXKd5AN9 k99z15c2DxNdNNhbdNjAPrGKW+N9daE6/UtSSe6i4KlRJ3w4WHt/3I8mIKPcWB653b orIbP+NakUBbBtLV8wDPKI9uoxR5ype9IgcXjljPIeWsWaNgp5T2zPd8Mj/F43fNOd tlRSC4eqjfZjQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Huckleberry , Dan Carpenter , llvm@lists.linux.dev, "David S . Miller" , Sasha Levin , edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, lars.povlsen@microchip.com, Steen.Hegelund@microchip.com, daniel.machon@microchip.com, UNGLinuxDriver@microchip.com, nathan@kernel.org, ndesaulniers@google.com, casper.casan@gmail.com, horatiu.vultur@microchip.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 6.0 75/77] net: sparx5: Fix return type of sparx5_port_xmit_impl Date: Sun, 9 Oct 2022 18:07:52 -0400 Message-Id: <20221009220754.1214186-75-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221009220754.1214186-1-sashal@kernel.org> References: <20221009220754.1214186-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: Nathan Huckleberry [ Upstream commit 73ea735073599430818e89b8901452287a15a718 ] The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of sparx5_port_xmit_impl should be changed from int to netdev_tx_t. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/microchip/sparx5/sparx5_main.h | 2 +- drivers/net/ethernet/microchip/sparx5/sparx5_packet.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h index d071ac3b7106..705d8852078f 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h @@ -291,7 +291,7 @@ struct frame_info { void sparx5_xtr_flush(struct sparx5 *sparx5, u8 grp); void sparx5_ifh_parse(u32 *ifh, struct frame_info *info); irqreturn_t sparx5_xtr_handler(int irq, void *_priv); -int sparx5_port_xmit_impl(struct sk_buff *skb, struct net_device *dev); +netdev_tx_t sparx5_port_xmit_impl(struct sk_buff *skb, struct net_device *dev); int sparx5_manual_injection_mode(struct sparx5 *sparx5); void sparx5_port_inj_timer_setup(struct sparx5_port *port); diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c b/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c index 21844beba72d..83c16ca5b30f 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c @@ -222,13 +222,13 @@ static int sparx5_inject(struct sparx5 *sparx5, return NETDEV_TX_OK; } -int sparx5_port_xmit_impl(struct sk_buff *skb, struct net_device *dev) +netdev_tx_t sparx5_port_xmit_impl(struct sk_buff *skb, struct net_device *dev) { struct net_device_stats *stats = &dev->stats; struct sparx5_port *port = netdev_priv(dev); struct sparx5 *sparx5 = port->sparx5; u32 ifh[IFH_LEN]; - int ret; + netdev_tx_t ret; memset(ifh, 0, IFH_LEN * 4); sparx5_set_port_ifh(ifh, port->portno); -- 2.35.1