Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7191873rwn; Tue, 13 Sep 2022 15:49:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR78dBTIsTXsW7Q0+35hSk/NrYEqRVmCJovMGSZ5dNvWGa0cR7MasFCtPiiEKTQGe/GdhGpb X-Received: by 2002:a17:907:7f04:b0:77d:5bad:46d7 with SMTP id qf4-20020a1709077f0400b0077d5bad46d7mr8406564ejc.663.1663109349334; Tue, 13 Sep 2022 15:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663109349; cv=none; d=google.com; s=arc-20160816; b=i0U2YTpJPRU9qZSr8M1RDQspJFNvuUOo9iyNgEobmNjFl52PBbpdengq0Ynq1R4Zt9 dowOl8h3WMBMUvFjNqT2yl9rcQX7QXrWcwXs6wMoJDsFB8o8Grvi7hCp8/twP5sXm4OG HG7IOefve+iPw5kk5Fzmwu4NRc082mBSyU3q9MnQ4P4hh3Bj9hPl9aztYnLiwqbsonzF JEeWzzcyxxbjQnm/8gVhOVMxwpC9DSdroNodmoLmm5VCb2MS7Od80iQlvx/PM4IT/e6D cJjowIlEdioHrpFVryFHO2X4GRGb74M/i2Qyck7cZ1Lb3Ixl3TkCiKBMRoRFCc3usWwN H7YA== 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=2hgmJGoEQ81ILKdbZXYnPT6mkQCkNfaRyjqRYHKI+HY=; b=PgE+GVyvRFNNjMs42+sdZd5GkYZs4SW6tpp9/GwZrkcv10hxOHy+/t+a4WpRZ8fcsn yJLb3TJgp08jvlJohVLzLE8LtRVCWSP3KqllCatjByh+v/4XjtRynTtt+0ymu4nT4bSY jefottPPla80vYWHvC5ARguFQcbd3mCj6OkTDI84M4RkqqzlQ2J5WaydRC0lhLtc8ObK 1n313eF0oQ+VIz8QSzq9wwIQlX1SR/EDkmqICmKxLECQOPViZsKIvfqlo7S0M6CCJQuP BsLUDwe82ECu3dyO+uerUNGbC+c+ilSaEb1ASNDODsFtwDavmJ9fqQoN/J3uH81qGZhY UfLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EbqSYOgN; 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 rq6-20020a17090788c600b007800b181a0csi1630563ejc.300.2022.09.13.15.48.43; Tue, 13 Sep 2022 15:49:09 -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=EbqSYOgN; 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 S229740AbiIMWbY (ORCPT + 99 others); Tue, 13 Sep 2022 18:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbiIMWbS (ORCPT ); Tue, 13 Sep 2022 18:31:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7F2C61723; Tue, 13 Sep 2022 15:31:14 -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 5B98B615F6; Tue, 13 Sep 2022 22:31:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCF60C433D6; Tue, 13 Sep 2022 22:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663108273; bh=CNNrVQXB5RHuPodp+2y8dbJdbh0v4jEbTVcWCwUBVJc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EbqSYOgNEkHCFSyUVPMegTUCUfNLiMKR0LTwYTZtN9tc17hwbQ0EGsw86v2JHL/tx JHERYk/ldz2bA32a5EZWSyDA1O/o/PlTIvWEhrUUwOetpXFuqOf7zFgjzzNLZ0r1eS iWiKaoRv4gPJUKdQCrvOHNjIGgnvt7GmX4s+eHxlFPc+bgJm3mUx990MxiU2EF0QrU G/amDn3Tw7t3m50Vo/i8tNUZG5Z95Mr6uf3o+aCnopIjsP6vfGnNZVoltVB06CAY7v f5kHtG1jv4A/yTM2uQj/bfWc04dKIUhn6KFWTy1DbxF2UYXOZhMyxuFiDao9HIUPkP 3rxQaLLMx/IEQ== Date: Tue, 13 Sep 2022 15:31:11 -0700 From: Nathan Chancellor To: Nathan Huckleberry Cc: Dan Carpenter , llvm@lists.linux.dev, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Karol Gugala , Mateusz Holenko , Gabriel Somlo , Joel Stanley , Nick Desaulniers , Tom Rix , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: ethernet: litex: Fix return type of liteeth_start_xmit Message-ID: References: <20220912195307.812229-1-nhuck@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220912195307.812229-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 12:53:07PM -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 liteeth_start_xmit 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/net/ethernet/litex/litex_liteeth.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/litex/litex_liteeth.c b/drivers/net/ethernet/litex/litex_liteeth.c > index fdd99f0de424..35f24e0f0934 100644 > --- a/drivers/net/ethernet/litex/litex_liteeth.c > +++ b/drivers/net/ethernet/litex/litex_liteeth.c > @@ -152,7 +152,8 @@ static int liteeth_stop(struct net_device *netdev) > return 0; > } > > -static int liteeth_start_xmit(struct sk_buff *skb, struct net_device *netdev) > +static netdev_tx_t liteeth_start_xmit(struct sk_buff *skb, > + struct net_device *netdev) > { > struct liteeth *priv = netdev_priv(netdev); > void __iomem *txbuffer; > -- > 2.37.2.789.g6183377224-goog >