From mboxrd@z Thu Jan 1 00:00:00 1970 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 AB9D8C6FA83 for ; Mon, 12 Sep 2022 21:44:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229992AbiILVo4 (ORCPT ); Mon, 12 Sep 2022 17:44:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229528AbiILVoy (ORCPT ); Mon, 12 Sep 2022 17:44:54 -0400 Received: from mail-ua1-x949.google.com (mail-ua1-x949.google.com [IPv6:2607:f8b0:4864:20::949]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3528C10FCD for ; Mon, 12 Sep 2022 14:44:53 -0700 (PDT) Received: by mail-ua1-x949.google.com with SMTP id z44-20020a9f372f000000b00390af225beaso3087012uad.12 for ; Mon, 12 Sep 2022 14:44:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:from:subject:message-id:mime-version:date:from:to:cc:subject :date; bh=ZdDMxu/ZwxZ1kfijbUS9jX+Fr0880+xk0f4yDMu0NZI=; b=TzmR12Pg0ciwHsSRilryLck3zq7AvCYzYIn5LknBVwADhQJbYBuVJhFfiRJzhoJGNl qx+w7EWJwj4oOMa5VXVaHsMB6Bpz2AMxgzkvBwjQhY1yqpB7EbixMDE+n6ZtBm2G9SmZ Mr4tW2dmGQE9SwT6bML7O7dwMaZp5Pc8e6SFkOMNyCA+JpuW+nktWMLc4CXT2hX8H3fL uFSIWAGmRrgsJUUYvPq0MsC2zASQ713KJJzIJcx+vVE/1yzaAEpW6/J1YUY5D8lnhE5h PE3/YgqQ9FxdoPMmnP97lybNvrzJXq4Odz6bFs6ajafdslKdNnJ5hpZ/iedjIuj4ykM7 OBsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date; bh=ZdDMxu/ZwxZ1kfijbUS9jX+Fr0880+xk0f4yDMu0NZI=; b=Q4tpB2J7sPlXJyzoaIkUokm6x8wgr9DCwiZD6e28hvS+ki9hoNMhL7/Xfunh5ljD44 WDnOS8XWHC/IRhdUuXMMIUFmxizdcfAfzNG7XKai9otMsKmrXexYXeo0cqyG6Yp1nSid 78F01VY3srBRX/lZhIRbUI/sN2/so8GGxNbddLWc46Cyl2b61BkH4yiC8IBIsXh6KPuD MgLRc85rzRYne61eeyRRUwFoYrkZs6seGfIf7pE3jHNBrsu9ebAv1CAICve1GIAn65vM 6kDI+N9QW30cuIiuD+lGWEhEC2LEyv8hQS5bNPfKg7VGGbBgjG1Zq9y6CYf6tP/KSBaD DFLw== X-Gm-Message-State: ACgBeo1fJkX8/nPEC0+bwZyhhsGohmRIWw8RGgXQJ8If8AGIR8a3R9jm Dgakne/gD3cdhC8ybivImX5yLCrO+A== X-Google-Smtp-Source: AA6agR6zF9XNyhGeFJB3NgH+4XzRWF08FblJtq30Iirz1/CziA6jHADZJImizAICLxZzt9PWN/yccy8XUg== X-Received: from nhuck.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:39cc]) (user=nhuck job=sendgmr) by 2002:a1f:6082:0:b0:3a2:1b57:795f with SMTP id u124-20020a1f6082000000b003a21b57795fmr3256154vkb.8.1663019092342; Mon, 12 Sep 2022 14:44:52 -0700 (PDT) Date: Mon, 12 Sep 2022 14:44:29 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220912214432.928989-1-nhuck@google.com> Subject: [PATCH] net: sparx5: Fix return type of sparx5_port_xmit_impl From: Nathan Huckleberry Cc: Nathan Huckleberry , Dan Carpenter , llvm@lists.linux.dev, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , UNGLinuxDriver@microchip.com, Nathan Chancellor , Nick Desaulniers , Tom Rix , Horatiu Vultur , Casper Andersson , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- drivers/net/ethernet/microchip/sparx5/sparx5_packet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.37.2.789.g6183377224-goog