Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7189711rwn; Tue, 13 Sep 2022 15:45:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR7N6EDnPIuHXJWRDehDFXoIBHvH8IggTCO370dafUASnKURZ7EM+s1ABsb5uqg0YR+NF3s7 X-Received: by 2002:a05:6402:520a:b0:450:fcc3:d321 with SMTP id s10-20020a056402520a00b00450fcc3d321mr19654607edd.327.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=F2U2zr0C6a25VTfp5n3HUD0JiFqqy52CooiUySJd49Ooz453wD1NBhl9WuRPBEnjn8 xisSrKioUW1PuCenPwBvkkeCh9sjaztKwuacmq4Q8tQPEkfPaW1tVXdf/k/ZVRpGwqn0 wsIg5APijWuqYvjf3dcFR1Ej1fh9EEJpj4UUezlw7gTLuNvIhTuBoYATiSm/KPRUlNxJ 9AHraShwTSlxWUr3VQlHrvrZOJ69Tdbc3qHLAbOiKqVJH10ZDFVh2rMSkxlvfhorhOim G071cMyaFDpI4w2Jvg1qm/5xkUv7zuw2Utyaeeg21zLKx9VqWwFYRfnBB59Os/puNIeE d94Q== 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=KSKW2q4IwMBcxeUpd9ZKFmawANpSwXTvEA/ne/ztVac=; b=L7LrnDcPG4zzvWPJADT+yLtu3D7d82JcQeAm8oiuA5SbDu4mBKXIJRFU+R9kQIiyen Fop2+/BbrOjlcYtdhg9W09cvO4OH2GGxaVnzbL4QrhQ8BviVq9qQCSJNrAkzenz8z/q9 P0pwjIUslw6VCYve3L6S2pPkUrqG6dTZJUTg6wokqLdFeiA+pAWXwUU8X/uUVWu9fw+Y oghYnm6XxR1StEr0YmVTHRmY3B+SDT1jLNDaa4XY3MOXxZNYZpyil5emJfhiA96cQAio I1rQxzUfoxKiFDAGMGfZql1cPu2JqKStLRGBqZ4kxzpb/z2t7/dDY1gykZwdnGvnr4jh E3BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SjO7EV1V; 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 dm22-20020a170907949600b0073d5b737a78si9534589ejc.752.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=SjO7EV1V; 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 S229657AbiIMWfs (ORCPT + 99 others); Tue, 13 Sep 2022 18:35:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229710AbiIMWfq (ORCPT ); Tue, 13 Sep 2022 18:35:46 -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 098E72E9E1 for ; Tue, 13 Sep 2022 15:35:44 -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 84EA7B80FF4 for ; Tue, 13 Sep 2022 22:35:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC2D8C433D6; Tue, 13 Sep 2022 22:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663108541; bh=/a+0hAg8mYXC9XGXNJ/uAASVNMvl9QrQiTnTEHk3aCg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SjO7EV1VAyigoz6PI7uLgWY6S6i5Qy78wXYKR4PhtOotnsP2tmyYMHDb+x4r7rAPf Nqsoogm8zTHL1T/EKHBHgBqDyt//QIshj/+ScRGFGM6RIO7Wh8EiJkMIcBoABZkA1f 0XV9aeJm0x9Ne5o/6i5ND5BMzxMWVdCSYe6+ijFfwaL0x7KxrYk3KTrILf3d8gFNrd LHEI424z46rRg52JgWZghncGx2GpvzcNUupk+6bWS0DMKyG/2Qlfl+LiBO1J1sdiT0 PfRdMtj0wOogmRrH2u8G9yY6A/RQseEPPvG1IV5sJpKp75NXiCcEQnQC6b31wJ2IqY lwiGh7rUABDxA== Date: Tue, 13 Sep 2022 15:35:39 -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: 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 Tue, Sep 13, 2022 at 03:33:24PM -0700, Nathan Chancellor wrote: > 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 Sorry, forgot to point out that the prototypes in drivers/staging/octeon/ethernet-tx.h should be updated as well. > > --- > > 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 > > >