Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp189512rwi; Wed, 12 Oct 2022 18:23:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ZRpr6GSrZKchcBvkR9zBhj+UfwQLNp9lLM/ws61sarA1mL52wO+cL9qh03Ut0v5fzzHrr X-Received: by 2002:a17:907:9603:b0:742:9ed3:3af2 with SMTP id gb3-20020a170907960300b007429ed33af2mr24455590ejc.510.1665624218224; Wed, 12 Oct 2022 18:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665624218; cv=none; d=google.com; s=arc-20160816; b=m5Faq1Zw6nIiWIKxfgfnQZdwbJgl3u/Y83PrtwxYmDtk6KU+k/mJRy7wVxe8rbhzOL 6Q1Q1y5Zq5UPfRPyDqXm5neeD8uGEwCWmIOiOqxDWZLgTn5NQ4W4lOMjXFW+SmekTt7P tt1YYG0FiBunXeUhwRl9QpR/NdSNncOnr5Oo5bnKg7DLyaMFe66thf2c0JuG94AYub7Z ZxdtQs8xjQMVVyJEIfibhjzgK1o1mT3Oso7Hc/CS0rRRQ6L5LtPoEXnQCt3po/DgMPkP Gvu/HOoB19fTuu4cvVP1PqjLmvxb4V02jiFPCkTLVtRXY4RLBid+Q5Py5zbkGV2HINT6 TysA== 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=PXUkISU5JSeLuT1lPF9RbzAsru+RsDc2zdzBqrDBqjw=; b=bBXi8Mu2aCpeObumKdQyvQ+zHaluuy7dkppBevIi0AvNXmYy+R37wepqK/9LJjeT+x NenW4k3+qnbIGJvmZIDOwQD7hvz2qxTyR3bLGsS9BasUVF6NBGSiNC7HtHeN3FdJpXVA JUZOcXYLXCoMpI59fewcZWECBlRNcnif51vbxiiJkC1VgcPc6ml7t8c7YHSe5QRpkv3X zywo0AkPJ0z8DmsszAE8Z+dA5WhBc1oFPiLipxYottFwVhbXon08XtBfCbVEOhrau3Bz VBYXSxPapElBJjaMseuqUY1u1YsAK8YRPwaEBQgx3yiP193eITZmthIthoET7+dzIdVw iyHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E0FKlOxh; 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 du19-20020a17090772d300b0078d4e67ca81si20083055ejc.605.2022.10.12.18.23.11; Wed, 12 Oct 2022 18:23:38 -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=E0FKlOxh; 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 S231202AbiJMBOu (ORCPT + 99 others); Wed, 12 Oct 2022 21:14:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231650AbiJMBNi (ORCPT ); Wed, 12 Oct 2022 21:13:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9BBD17AA7; Wed, 12 Oct 2022 18:12:34 -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 12F81B81CEC; Thu, 13 Oct 2022 00:23:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B41CAC433D6; Thu, 13 Oct 2022 00:23:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665620591; bh=r6vSej3gjd+5Y2O1GhWUlII1RKH5uIuDL/+bhV/uJhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E0FKlOxhqngBqMEOZJxv0/wg2YeEsqpPfP5HZ94pOEb7y441VPkF7KmJSaIOH0oee 5rpsdMDTrX8wIHoq4HoEbGxUr5AV9wuQouszWfw0VruXrRftON2PT5Z052GTw/ax7U SRJe4SPwkpUizqh3NY6vIfrDi63+Gl8rljbqE2GDJ/OloDzVwwckpV9Lc8oqMsfRec OPCRdbG5+r7KD+k56pyZxWTXkFyxnIjtyF1NHpK3X9mSGKdOde5K5XSE5oIS+xH2Dl g7eYPzJCd7o+xHozov+VI2QJ/CpBkOx7ostI062WgevTNTh6mtUvUm9/KPTCV8OtCM 3k/dPUJNWWAVg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Huckleberry , llvm@lists.linux.dev, Dan Carpenter , Nathan Chancellor , Arnd Bergmann , Greg Kroah-Hartman , Sasha Levin , ndesaulniers@google.com, linux-staging@lists.linux.dev Subject: [PATCH AUTOSEL 5.15 38/47] staging: octeon: Fix return type of cvm_oct_xmit and cvm_oct_xmit_pow Date: Wed, 12 Oct 2022 20:21:13 -0400 Message-Id: <20221013002124.1894077-38-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013002124.1894077-1-sashal@kernel.org> References: <20221013002124.1894077-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 b77599043f00fce9253d0f22522c5d5b521555ce ] 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 cvm_oct_xmit and cvm_oct_xmit_pow should be changed from int to netdev_tx_t. Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Reported-by: Dan Carpenter Reviewed-by: Nathan Chancellor Acked-by: Arnd Bergmann Signed-off-by: Nathan Huckleberry Link: https://lore.kernel.org/r/20220914211057.423617-1-nhuck@google.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/octeon/ethernet-tx.c | 4 ++-- drivers/staging/octeon/ethernet-tx.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c index 1ad94c5060b5..a36e36701c74 100644 --- a/drivers/staging/octeon/ethernet-tx.c +++ b/drivers/staging/octeon/ethernet-tx.c @@ -125,7 +125,7 @@ static void cvm_oct_free_tx_skbs(struct net_device *dev) * * Returns Always returns NETDEV_TX_OK */ -int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev) +netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev) { union cvmx_pko_command_word0 pko_command; union cvmx_buf_ptr hw_buffer; @@ -506,7 +506,7 @@ int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev) * @dev: Device info structure * Returns Always returns zero */ -int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev) +netdev_tx_t cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev) { struct octeon_ethernet *priv = netdev_priv(dev); void *packet_buffer; diff --git a/drivers/staging/octeon/ethernet-tx.h b/drivers/staging/octeon/ethernet-tx.h index 78936e9b33b0..6c524668f65a 100644 --- a/drivers/staging/octeon/ethernet-tx.h +++ b/drivers/staging/octeon/ethernet-tx.h @@ -5,8 +5,8 @@ * Copyright (c) 2003-2007 Cavium Networks */ -int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev); -int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev); +netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev); +netdev_tx_t cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev); int cvm_oct_transmit_qos(struct net_device *dev, void *work_queue_entry, int do_free, int qos); void cvm_oct_tx_initialize(void); -- 2.35.1