Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2566994rwb; Thu, 29 Sep 2022 11:54:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6gJuWfUW21ITTcw0Uk2KrgG3rqHwLDG4Qenanlijh3z8e9Y3PRTQddEcvTiyt4hpTg9MPu X-Received: by 2002:a17:906:5d10:b0:784:b6c5:78d0 with SMTP id g16-20020a1709065d1000b00784b6c578d0mr3820881ejt.348.1664477679786; Thu, 29 Sep 2022 11:54:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664477679; cv=none; d=google.com; s=arc-20160816; b=M2qEN0XrSlXcqSgTlnYiV9BaWcRhSUXRNdh0VO2NIrF8DeDhyxsZrv1UbykgrTEq83 RUEtJUic8lud0ZhIiDRxG6U7/SMz80EugiXRpPBRZU8aqO2opdFLELfRAzeaXJhLL7c/ JmQMoSIlWz0b40qgMbr6vHlZuThOMXun5vChkvzHsHL5v13iLC3eP7TGEwErUNiaeLNz BV0wWaLy9R1m/84hE2pKqIb7MyzfJi21VKc4Er8Qpb87fB9CljlcFNhRuImjMzvNQtw3 ZaN2x/W/D1WMXz6WZ6/L4DRaljjoE+7dulEm49GIDRSW+Xoc6m+tIpbsGo/AFW26F/PC tcqQ== 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=hThg0pfN6CHiqCtmCKStXEwE9zcxx6CXkirL9fUXOVQ=; b=IamiwWaziZUtx5rzGKcpGmoiTWlGFYIOAlKxV4abEKlyw5B/1/D4jvanmysZio8poq UomAs8F6WvLc0tseQFbEwzWGzkc4eif3w0+M16ZKVej7lZFDGOUwCcJymDozrI1V0mdg uPC/+dAOAqbRqnq5WdW+us2XwTYJj7tl4b9tJfLte3/xNKqMOt1Uno7gQnPIy2RYOQt7 HNVoyVPYyzYinIOY1zEyo9RfouYH73Nl/HAQYLgNs0Em1GDxbyk/O82/G6C9nTDLl2AL evMJ7eihlJAD8YkQGCIGFPDo7FnYW+NfWEbF30vO5B7bc65bao5MTlbGmDa5sPfa4Lu3 MHeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RHTCEw8u; 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 g11-20020a50d0cb000000b0045858a12c59si177234edf.413.2022.09.29.11.54.14; Thu, 29 Sep 2022 11:54:39 -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=RHTCEw8u; 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 S235774AbiI2Spz (ORCPT + 99 others); Thu, 29 Sep 2022 14:45:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235576AbiI2SpW (ORCPT ); Thu, 29 Sep 2022 14:45:22 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC07072B40; Thu, 29 Sep 2022 11:45:02 -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 sin.source.kernel.org (Postfix) with ESMTPS id 0E5FECE2368; Thu, 29 Sep 2022 18:45:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E786BC433D6; Thu, 29 Sep 2022 18:44:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664477098; bh=GhiMP37z6iD9dr2AzNoaCONOVGPUM81UxwDaptwk07M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RHTCEw8u6eFHH5yhzKSVA2uqMxZqS/Y3MXr3srRfTRDcnnkuuRId5pPr55qgV6qM8 gXAQqGpC5apfQcHqr3TLsJ2NK8o+EqJll4z6J4lDtt7oiZQUrEy4AbyW8YtFUogxTT 2vOJaRua/SSmHtvKHB+BSsPCz9prq0Ow1AznHHy8lyZZX/MtmLZGsbPt5EtuRalSbh t5xonO7CSRbEfbfZNpqwBzwP+dWUGZ908qVusv1K9NiEvkRwMwQugoK7VY3yPeh+hP Lx8CUu3LgFKCzg4hBbX1HdfMfvf1m/mynq7IR5ZkQb1Hs5rIvLRWlg+eUnKbeKKLT9 b8czLCXht1xnA== Date: Thu, 29 Sep 2022 11:44:56 -0700 From: Nathan Chancellor To: Nathan Huckleberry Cc: Dan Carpenter , llvm@lists.linux.dev, Horatiu Vultur , UNGLinuxDriver@microchip.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Nick Desaulniers , Tom Rix , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: lan966x: Fix return type of lan966x_port_xmit Message-ID: References: <20220929182704.64438-1-nhuck@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220929182704.64438-1-nhuck@google.com> X-Spam-Status: No, score=-7.2 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 On Thu, Sep 29, 2022 at 11:27:03AM -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 lan966x_port_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/microchip/lan966x/lan966x_main.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c > index b98d37c76edb..be2fd030cccb 100644 > --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c > +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c > @@ -344,7 +344,8 @@ static void lan966x_ifh_set_timestamp(void *ifh, u64 timestamp) > IFH_POS_TIMESTAMP, IFH_LEN * 4, PACK, 0); > } > > -static int lan966x_port_xmit(struct sk_buff *skb, struct net_device *dev) > +static netdev_tx_t lan966x_port_xmit(struct sk_buff *skb, > + struct net_device *dev) > { > struct lan966x_port *port = netdev_priv(dev); > struct lan966x *lan966x = port->lan966x; > -- > 2.38.0.rc1.362.ged0d419d3c-goog >