Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7191931rwn; Tue, 13 Sep 2022 15:49:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR4W5dlRrOdperNeDT+ofsv2BQfdDmj7mlhNs8kw8p1Su+7gIz2pntHLUJuIJE8tOmmGdUgH X-Received: by 2002:a17:907:2bd8:b0:770:77f2:b7af with SMTP id gv24-20020a1709072bd800b0077077f2b7afmr14135896ejc.545.1663109354867; Tue, 13 Sep 2022 15:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663109354; cv=none; d=google.com; s=arc-20160816; b=eQB3btoYKACBms3Wr1HU2oSWbBkTzTt0uryg9W8oZ+l6l55JUseA27LuYTFx1XjXBt 4qu7rD0K86DvmxEahzkYL4AyeoahbRoFflhqGfixy3KdENRHFL/VvIf6MoW1rrziW234 Wq3x88fv03k22sJoViBFkpgegX8gB3VlwlKj67tA5LJT4ihwXVeJLI73NVwXaWrYWP1G BvuDxXfSd65Ax7wendFNgFukUpJAj/iVgzh0n4FSqHvvS1E9l4VvbTuzPRSIAhAzyFqB 2n9ILlcBypafOvYMITizixhWjk6KogXiDVkDVw3kFISMN63mSACvx9Ejx8MGY6XL5AvM so4g== 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=H2dSojwNw1uJkBDVSN/eujCrk58LFiaWzpcd8AllH90=; b=FzNaKyO0hlLp5+VX//fPf9XOFdcLCDxN/yuk/VHAMwvrjOc8JcUrWpB4vDFkCXprnF /h7dUvAXN6xCeDTtDAUspUt+E0imG6i7sDC4Q/Gi6zeYGCvmOoxHLDeZNjRCDuyPf0Jp WC9W8f2/U/gEqglP9dnARpgowESxtTUXLPCx56N+h5sshoAnvhjl+mCp1a4pY8l8n/hb qdJ0cXXc+GKCDAuSm0QCMFjKTiO/22riEAKGvz4ZPv/iOJVyuGd5xRguO8VPAvy+PuS9 ku0kjtGJS0j51aWEQMGA3nf+eKxSEUAPfq4p5gNbu3eS2kQN0QgpWU7vI8QFELVG69w7 ZaMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sbZ6+KQw; 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 hz2-20020a1709072ce200b0073dd946b66asi9628367ejc.444.2022.09.13.15.48.49; Tue, 13 Sep 2022 15:49:14 -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=sbZ6+KQw; 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 S229492AbiIMWa1 (ORCPT + 99 others); Tue, 13 Sep 2022 18:30:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbiIMWaY (ORCPT ); Tue, 13 Sep 2022 18:30:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BFF05A2D6; Tue, 13 Sep 2022 15:30:24 -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 A38EE615F3; Tue, 13 Sep 2022 22:30:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27421C433D6; Tue, 13 Sep 2022 22:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663108223; bh=rVjxb2dQV8sLfi2r4499txSukl32Y+SJ5+wsRFGJh9I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sbZ6+KQwG7HZOcmSmYGdTspEWGshOnI69SlPdjBNxO4onmvt9RpC81lf6sJG52NX5 CyAvNhz8T9I/QRrkyvKr2hB0xz5WSRctUO43LF/3bIV4M13AIHDIJMELp3TPCqUY6i +xShwPL+uKC7FTUyevbOQ96XXDH75zSH7Cu1S6yx1e8wABnnG5lqUKqJw2JCIDpnzT eNp4txLmHFsh9b6I3yO+9aHv4/OW4JXsE/OvdQryXtRMqNlo5+sw7xtjqAGWMcgSUf 9kxB04Xm9GoB1zQEOoZj7becoGiFRasAHByjJf5oHDNLYUj+PJb/OTdpAEz/c+G3y4 5scn1cqo13NgA== Date: Tue, 13 Sep 2022 15:30:20 -0700 From: Nathan Chancellor To: Nathan Huckleberry Cc: Dan Carpenter , llvm@lists.linux.dev, Grygorii Strashko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Nick Desaulniers , Tom Rix , Lad Prabhakar , Maxim Kiselev , Minghao Chi , linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: ethernet: ti: davinci_emac: Fix return type of emac_dev_xmit Message-ID: References: <20220912195023.810319-1-nhuck@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220912195023.810319-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:50:19PM -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 emac_dev_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/ti/davinci_emac.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c > index 2a3e4e842fa5..e203a5984f03 100644 > --- a/drivers/net/ethernet/ti/davinci_emac.c > +++ b/drivers/net/ethernet/ti/davinci_emac.c > @@ -949,7 +949,7 @@ static void emac_tx_handler(void *token, int len, int status) > * > * Returns success(NETDEV_TX_OK) or error code (typically out of desc's) > */ > -static int emac_dev_xmit(struct sk_buff *skb, struct net_device *ndev) > +static netdev_tx_t emac_dev_xmit(struct sk_buff *skb, struct net_device *ndev) > { > struct device *emac_dev = &ndev->dev; > int ret_code; > -- > 2.37.2.789.g6183377224-goog >