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 AB101C4332F for ; Thu, 13 Oct 2022 01:14:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229893AbiJMBOx (ORCPT ); Wed, 12 Oct 2022 21:14:53 -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 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