From patchwork Mon Sep 12 21:44:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Huckleberry X-Patchwork-Id: 12974133 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44648C6FA83 for ; Mon, 12 Sep 2022 21:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:From:Subject:Message-ID:Mime-Version :Date:Reply-To:To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=7t5q7CGlcRaWztrSPZpQ4EgQIIPy8Qbg3dVsr8bFfTQ=; b=ER4R6QVMBeTSxq CLuqe4A94HUftCjMoBadvmAJU2+SrUsCCnDR0unRGewvzLPTMKZoOvy/GoH1btFe0ob6U5DSYZ6hV E0RzXY1QJ1xLFW8sHGXLwHAa5CMhQn5rS2Gg1Z1hAhoC8uIXarpWuh76vd6zxUniQPK53kanc/568 htECpWzEqtiGJTD4+8gGzkC74UAy8mXdil9PH+goryCBm10xnG3H5FVFRIT/ZbubKr2NuSQiduzOm tugH71jFNfDHYbb/zg0Z/MBWkQtIAN3+6jSiPNOG/+cN9v0MdMwd1QkKBhPrf+d7sURGEfof99gxw 9v+0buSBZfZriM2HJUvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oXrEh-00EIky-3C; Mon, 12 Sep 2022 21:44:59 +0000 Received: from mail-ua1-x94a.google.com ([2607:f8b0:4864:20::94a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oXrEd-00EIh1-Fb for linux-arm-kernel@lists.infradead.org; Mon, 12 Sep 2022 21:44:57 +0000 Received: by mail-ua1-x94a.google.com with SMTP id h19-20020ab01353000000b00392f0767f64so3074653uae.17 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=nG7uz9v/FgTmhmal/g4U6L8dEh8b2qkmwVKY6uRcdvdM0CRA6Um2ThP1L78jnkDVuY VCLXRXz+07cGG+UgfjT8z2FHTxRPCwY/g+S5wPuYEvjpvvbYcDXOIvBbcX+9QgbRSan+ wZlusXHSOc2wstsrDssS0xkF5juJHxylzQOD1fN71eMi4u4wfe+rFnpF0Jf+jyZIMazW D2MSGDtm2NG6yBO+a3+zLwLVWsBHT+rJNCc4efvXdrOqLoU2IMDacGelk3jBOqxo3spE Ss7U7y+hwL3MqWidlByd3J+NWIxD9Dv0+0gZuvOwAE9jWpJCC1MN+cf02Ey0FN3IXq3Q BviA== X-Gm-Message-State: ACgBeo1TMJ+lYVLuiCICvssryZ6PTdUNNtV9r7QRmf+ZocZ/D8xtllRT Ftv1gysGEyOYIr42zMu9zjqdBeejkw== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220912_144455_543590_6C869835 X-CRM114-Status: GOOD ( 13.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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);