Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7189712rwn; Tue, 13 Sep 2022 15:45:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR49hWU4wRpYJjSwvtFe7SSJNlCrhxFoMZ/HLkoq9F6PJFYJYXvqTLep9HkDxzcKNimFKOKL X-Received: by 2002:a05:6402:4d9:b0:451:f433:dced with SMTP id n25-20020a05640204d900b00451f433dcedmr8099997edw.42.1663109145865; Tue, 13 Sep 2022 15:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663109145; cv=none; d=google.com; s=arc-20160816; b=a25waV+F+OYPXycTvqZQtEhrWwMeGLqWmSj09Q6eTW7OmR+T5d0NbjMC9NnLlbtCfu KTOtWBw87c+zKUduCPYEcReNOyeFcxqIxlEUt1P6tndxp28zhofH3D2DA2HA2NuzpNFk iKTf2i7XEoQzgMUpczSc0+lGbHCV+xz1RsMyFGqCQXyJ8MJPuyhRG14CuY3Ffsje6+mw +H+47/i6ydkUVSyj8aYhKZniqUTD2vFJVGbjmfTEwEwKVZEnmBk1BiBDeE3c6mhA9bpW Gk5pQASqgfWq5LHBwBIk7vQLP8Un8JafUo3I2wedus1dUkPXD4j1JQSi+rL95NiYDx9t 52Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=e4MBZLPAOinCb0QzwGwi5fPu001eA9VC3f1LPWusz6w=; b=BxEbB6t4TntzhKbdplfS9ClLr8aIMYMd/hJsYXAH5ePFOTG2pGZxfk22Jb57bLR4lp RYHkOpqBYG6AGJ2+G6AGyXpF57CgU6iZfWxgZKcs+A69rnKyYzQNE4XnFyOlCKdqMvwR P14JyNpfwZtt+OzrumbedxFLyYbOBQPA/0ZEre3MgkBdq6b2rkjmLEfEiAh2VpKber3S O5PaoQLUmwrWZUjjdIAGkG9C1fRks0fZDjWDRmEiegXNvL/64wX/3ZkpvqB+OjgJFcz/ G9H2VFV3WmbOQIxhYLrWTn9mzjdXGwYcDI0giHXq/hVXUqj4jOe09GCX5r/FbV+gcgiq 7F0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cd2GiwwL; 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 hr30-20020a1709073f9e00b007802b03c3a7si686319ejc.678.2022.09.13.15.45.20; Tue, 13 Sep 2022 15:45:45 -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=Cd2GiwwL; 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 S229574AbiIMWdc (ORCPT + 99 others); Tue, 13 Sep 2022 18:33:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbiIMWdb (ORCPT ); Tue, 13 Sep 2022 18:33:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D6845E57F for ; Tue, 13 Sep 2022 15:33:29 -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 83B0FB80FF4 for ; Tue, 13 Sep 2022 22:33:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA317C433C1; Tue, 13 Sep 2022 22:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663108406; bh=dqukAa/QNATCYFRuSfax+0gWFcpGIvrk73Zu/gYLssU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Cd2GiwwLpN00ybuNm4ICzIjRbOP/S/odTyDR9d8QBQRSHENwHENk7bl0NBkwZb5Y+ ccGh2Ca6tJTgJPE9gmNIZhse71WapB96qTRZL3LNOkBZTkzbqMy53uL447A+sG8JZP BvzbkLCEF3AfZO5yWa2TCGkrRRwL+8JFdlKc35zh5dUk/GrgQFmvFrs446/bWl4I0a qWeqCZzG8EhJKG1xr2nXJsDxbAQPXs1bEjuyhdzjZI4vDPk4Q/O5I8Su1GFgB7A96+ o/uvb/rQsjFQhNLsjuPZPi8YlftX29lkRtNDjEANEq19NKLfhnILYyDGwWDpEP+jdO elbDs03pHfQxA== Date: Tue, 13 Sep 2022 15:33:24 -0700 From: Nathan Chancellor To: Nathan Huckleberry Cc: Dan Carpenter , llvm@lists.linux.dev, Greg Kroah-Hartman , Nick Desaulniers , Tom Rix , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: octeon: Fix return type of cvm_oct_xmit and cvm_oct_xmit_pow Message-ID: References: <20220912214523.929094-1-nhuck@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220912214523.929094-1-nhuck@google.com> 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,T_SCC_BODY_TEXT_LINE 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 On Mon, Sep 12, 2022 at 02:45:20PM -0700, Nathan Huckleberry wrote: > 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. > > Reported-by: Dan Carpenter > Link: https://github.com/ClangBuiltLinux/linux/issues/1703 > Cc: llvm@lists.linux.dev > Signed-off-by: Nathan Huckleberry Reviewed-by: Nathan Chancellor > --- > drivers/staging/octeon/ethernet-tx.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 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; > -- > 2.37.2.789.g6183377224-goog >