Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp177686rwi; Wed, 12 Oct 2022 18:10:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM409rU9pzdXO5sCq10EwtsouC6mOX+AcCrSzOguhilAl3ckX17DB7WXm3JlDKdxpIx012lt X-Received: by 2002:a17:902:ce86:b0:185:378d:7bff with SMTP id f6-20020a170902ce8600b00185378d7bffmr68958plg.104.1665623400047; Wed, 12 Oct 2022 18:10:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665623400; cv=none; d=google.com; s=arc-20160816; b=WxL+cwkaxy4ZxFDylBN2lcIQECvfae9AW6G8vm9OvpWkSrP08wcWltr9hX6BK3Onuz O5NL5BsEScnLu0wazJMZ2rtNH/2NTKQSfDIlhArdBi080mtg0rt40A8YsGngPeQiZyqo ++JofngYDE//BCdd+SWyBiD9V0JPPZeC3dwVF4MpdhgnQASzzKkk5vCGp9gWM3aVlWOK JEqKQAHKARUOxPgr+jpy5b+xDvh2e46kEhsxGZhF04HyR/2QVNzHAwALfH02XcEQS4yq wCk7DTRhyYbP1TKo2n3hmB+fJxddDX6pMEEkvOpD97N7oygoZ1M1+v30KHeMBJwCVcms GUSQ== 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=wHApyhiwHIc+PR1J2UfDNGux57zJSMoGiopCB8Nm+q8eCHOvoTPg7SFMV7uaH/XtMZ jTA3RKePvsN/5POBg3eG+FEWZ7m1QHvEz7K4NAAxIjhVwFpDY57ABLVul/Igl4BLtLQE c+LeQwD6TJYXECRjvVISWbZ+X+Ap9eC01O7/ELwB6HPb1G2mnFv1CFmqeWT9Vjo553cb KL0JcddTExR0VAIFw1Dkp/JmrX0jxxNVaT6jUcFzkm9DzUF1c/ng6BH23pofaR0o6Un6 rDmIVTX7LszwS4TWW/ST/Rrru5p5HBmijHUZ09G3qg7PD32SjUR+rvZa6019Dym4mAof 3EfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cv7yFP1m; 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 a8-20020a63e848000000b0043945685064si20492842pgk.26.2022.10.12.18.09.47; Wed, 12 Oct 2022 18:10:00 -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=Cv7yFP1m; 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 S229788AbiJMAVO (ORCPT + 99 others); Wed, 12 Oct 2022 20:21:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbiJMAUY (ORCPT ); Wed, 12 Oct 2022 20:20:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86541AC483; Wed, 12 Oct 2022 17:17:55 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 34ED3616C3; Thu, 13 Oct 2022 00:17:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FE21C43470; Thu, 13 Oct 2022 00:17:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665620274; bh=r6vSej3gjd+5Y2O1GhWUlII1RKH5uIuDL/+bhV/uJhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cv7yFP1mhlcfhT9ouu8FbzO0hbWs5sbj5CbTvkMTsOq5kvoWD1jmqNWmLH4/Z2Yqn Le3RwpcPn0nvQ8G87KbuUYDAYTiW+Arc5DWci3XGyDSoLHTn0/J0fBXO/ZIDoCl4Ok P/+JJOZHfZjYV9K4McydsBNcUMub1A7EI6WzwovSAhnMbv5pD8eQ848AXtM3sV0xgG x/C97QHpK1Y9tPNHHaPzzPmrPWzKpuquKTz+zfDe/KbDDjMLKr6KFjVj/N1xu4zF3X RwWpuQcd9+UrWFAnwf6rVEAn9R4stO6f0AM1tIYpVDKlvq4nOyS6T/pKQC3JKVMUCf 1HHHErZLuEbGw== 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 6.0 48/67] staging: octeon: Fix return type of cvm_oct_xmit and cvm_oct_xmit_pow Date: Wed, 12 Oct 2022 20:15:29 -0400 Message-Id: <20221013001554.1892206-48-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013001554.1892206-1-sashal@kernel.org> References: <20221013001554.1892206-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