Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7191655rwn; Tue, 13 Sep 2022 15:48:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR7gydeYHp1m+q4XqKoUHSzLOMiKfpJD1Zr289loyPb64lfa3b/vEtCyfAqOIT9hcWUja0yo X-Received: by 2002:a17:907:320c:b0:741:1e55:7a69 with SMTP id xg12-20020a170907320c00b007411e557a69mr23797874ejb.740.1663109327586; Tue, 13 Sep 2022 15:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663109327; cv=none; d=google.com; s=arc-20160816; b=n/N3szoV166BQ+FIZUfArUBm30P8q+qHcOMzFIelVMD5byMYft9NUlWqYwUSFyq3y4 wiGMlnNOSWT0m6rIQEvHGFp+K3cc6BSogU5A11TWr/Jfxw/XnTf9ebWPCt9Z4e2jxbwJ nNhvFO8L6Jtxp28Vqbc/ciP5IFexG/RU4hn5Kj8bhUK0AfMH3lNdYZNrW9PJIaDgiwFp yprGjWRPz1+yD3oZ8Rd7NJ/1qoJm/qzCCHYMVDs0jEExXcLPiSllPdQXcy2hRn5/rgmv DKW3QMi4u1iljcDeUpWgDvOdjdz19F+WHi7eW4q3Tjbqvi+7pkukEkl01oDj1Wc0gCr0 bkFw== 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=LGTKZhYdISFSZZQ5a8jXLXNQAF/5RhxqddJV5aZTdtQ=; b=qsxXJKlo3xNN44XyJuvDnQkOcCwmlZyLxIFEKngJ1fQpd1v2wp8MM9L0IL0BvsdrIS MRa2/vyITCZLesfpRUqb78IuVKS4c37ZHUaJOfd28QwOXk/McpTIH/HX7MaLHro9MTB8 aPqyJr5T3IY0kNvCt3PJ2KBvS3PZ1JdlE9ENGSSAlBiqByLByiE3qBM6zFxIh9l+VCmZ JW+y10mYs/GjYeLw7yXC1e0YQ6eeobVjPt4TLwHIK/aFutqxK+FgLYG7j4GkN5Wr5d2p y7peDP/1SDsddaP8k5eNd+CNWQKzpmiX7vuQOZnc4NNZd7H/rkCG1A+bVGYAZnnsLIV7 dCeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uDisfPbZ; 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 c19-20020a05640227d300b00451bc675cc9si5234722ede.335.2022.09.13.15.48.22; Tue, 13 Sep 2022 15:48:47 -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=uDisfPbZ; 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 S229552AbiIMW3V (ORCPT + 99 others); Tue, 13 Sep 2022 18:29:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbiIMW3T (ORCPT ); Tue, 13 Sep 2022 18:29:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C4185A172; Tue, 13 Sep 2022 15:29:19 -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 B9D9461607; Tue, 13 Sep 2022 22:29:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E96EC433D6; Tue, 13 Sep 2022 22:29:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663108158; bh=YeIdUhpezu+PSJF2j8F0mUYzDwOXfM39RU0PHsl2DNo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uDisfPbZdMVcviSHu3pvOq/VmFQqmTM3flSTCcgGXVUILoSHAO5gHUK7sE2ExABV5 iJHkE9p/nJjTJjYQfgVJUlgHHUratE1HPf26eRMyzF3zZX88Q95bpZaoLBYJjPtqm5 MQuu1zzuEMU9hG0MUxpXVbJM1zdygMBiF8LCznnslNqwQJjy5PvZevA3WcYKYt66tJ dbRfBtDKBSM6RbsMjixdiQm1oC97GHdeEGfshsktCWIlqUTDeHpJ4muTUZF/3WTZO/ YJvcLJ3dC3wuuki6SzvhMMoylD2D45GfL/UvgSvn/arEZ8Aj5kF01t64vFd44/Hk0x NUyqzrGTiKP/A== Date: Tue, 13 Sep 2022 15:29:15 -0700 From: Nathan Chancellor To: Nathan Huckleberry Cc: Dan Carpenter , llvm@lists.linux.dev, "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: davicom: Fix return type of dm9000_start_xmit Message-ID: References: <20220912194722.809525-1-nhuck@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220912194722.809525-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:47: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 dm9000_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/davicom/dm9000.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c > index 0985ab216566..186a5e0a7862 100644 > --- a/drivers/net/ethernet/davicom/dm9000.c > +++ b/drivers/net/ethernet/davicom/dm9000.c > @@ -1012,7 +1012,7 @@ static void dm9000_send_packet(struct net_device *dev, > * Hardware start transmission. > * Send a packet to media from the upper layer. > */ > -static int > +static netdev_tx_t > dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev) > { > unsigned long flags; > -- > 2.37.2.789.g6183377224-goog >