Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp490703rwn; Thu, 15 Sep 2022 01:44:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR5WvUMysnXV5UG68Ab2nk+ulq6WtUgFLrHYLiOJEH254EIjWfMIQqHJXB5r5IjUdHGzy4Pe X-Received: by 2002:a05:6402:4515:b0:443:7833:3d7b with SMTP id ez21-20020a056402451500b0044378333d7bmr33300324edb.151.1663231473639; Thu, 15 Sep 2022 01:44:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663231473; cv=none; d=google.com; s=arc-20160816; b=JyhepG0eSBFjXzbxKYfNTrbuGHHVVX9bokSmP+wr8C8ItiQC/0JIb6/INxOKYzSHrJ SFqP+uNJaKNd3hqUJvqQJ8fOdzar/nS7HObPPcpQK6aHKVK+S9intcq/NpUlHNQxlYF4 7fZA4jxvnV+wOt1kgrtnuU9iFTHm6lIeUPM42fmDw11/UXXLNgcy6/DfFCWjIzQJtxP/ mu6gcbEQ6xfchmAtmdEgCdtFtqackuykCKQGpkV0ahTTURizdygj3GN9DnbnpuRhfSs1 JEUDkFGTFyS+uQS0+V33eRJNoYfJSveYclX3OGggQnXcuGZRVFrMyGu4QFQGlt9HFjta 1tlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=9mKn6blmYANFuaZ0dtOqisfOd8Rd6vzhg19KJ8Gas0w=; b=ajKx3K6jXlokh0qlVVEG9Q4zRC3bxBGhnkzqFmn3QwnCw+lGGYXtXVfdF5NIVO5LAi 87YfVTHeZcEfqNVFiU7xSLE82XqUtnxpwyOFqdEbTichOMcybfgsZ3E+SXeyfvjmndZq lxuia+z5DjZ56qdAilJNmJz3Gqk2C4HE47k9rUhA7OkfXOqy7blqWrNM7zMkaW4nDvuu RpIkc15v6qMQuZsu979aRPS9WZa+gzPLGEsIXeBkuEuIQdJjrAdFL9mujZyGHkFT1pzo W19Cc6JzNCOPfJBc0bmFWxaRHEXrtpPlcQcsKCro0dGbgC0TRZNbElsenydkbSv54k4O bQaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=dkrfo0E6; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="b5KYyzw/"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv11-20020a17090760cb00b0077c0d775760si14068436ejc.173.2022.09.15.01.44.08; Thu, 15 Sep 2022 01:44:33 -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=@arndb.de header.s=fm1 header.b=dkrfo0E6; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="b5KYyzw/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230270AbiIOIZj (ORCPT + 99 others); Thu, 15 Sep 2022 04:25:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230247AbiIOIXd (ORCPT ); Thu, 15 Sep 2022 04:23:33 -0400 Received: from wnew4-smtp.messagingengine.com (wnew4-smtp.messagingengine.com [64.147.123.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0906A9836D for ; Thu, 15 Sep 2022 01:22:54 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id 465702B05F8B; Thu, 15 Sep 2022 04:22:53 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Thu, 15 Sep 2022 04:22:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1663230172; x=1663233772; bh=9mKn6blmYA NFuaZ0dtOqisfOd8Rd6vzhg19KJ8Gas0w=; b=dkrfo0E65c8JJoicwHhtCyqEqn YT0dufOKnphOC2mruIY0Kz6gecCS6aPSgDCZgJ2lsTrk26ZDmaNEmuWWn5kq0ng7 gB7/cv52eEujaA4q5hFiFrS1MQ9XA3vZzgZVfXVNLebKz+s77esbMuU5R2nQry3S gTniSwul5hXnk0az9QzN10tzkrB/D5LN3xHcNj+AbAkxF9XcvWO+EILkMkH7wh0o Gv33ba7NZRONh6Lp2kaVfDWq8NXpp3YciblIkbJSalMubRjLVhNiWLbcu2Vke1sN lKLOVJMH/vsOfV7y4aCdyTsHrz1QNc/gQECipkXGyCf4yGDpQLEuc1ixTbbA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1663230172; x=1663233772; bh=9mKn6blmYANFuaZ0dtOqisfOd8Rd 6vzhg19KJ8Gas0w=; b=b5KYyzw/+DD85iAltMyHonE25aj06cE00CMmDAPxOurs a/95BYFawT3nExW/s8f1MtE+KAGK1PQ5jjnL+ghzpb2AtcnJKDJMZJ8cR7XfA350 ixLfi7T2+GOYxTWjKklX5sQNkwrdKf09tGWs2iAKxwhE423vXMdFVALEBL0P8yYO AzAkNIRr9ilbcRPM0enDKQjzxDEEA/AeKxW31Gj7sAPjCWwvnPdp0cAmtSAtZtzt QUfXP/kkYWdAan1j29e3tUDKg/1k8ph65DynFNbTo+l/Hc5nfaBYbsf9tzUH1dxF LYVmqwYLjfl7uAhCg68obx1joWFOXjKtJKtb/NOnXg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedukedgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepjedvvddvudeludehjeeitdehheeivdejgfelleffiefgvefhhfeuudfhgeef feehnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6F2D9B60089; Thu, 15 Sep 2022 04:22:52 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-935-ge4ccd4c47b-fm-20220914.001-ge4ccd4c4 Mime-Version: 1.0 Message-Id: In-Reply-To: <20220914211057.423617-1-nhuck@google.com> References: <20220914211057.423617-1-nhuck@google.com> Date: Thu, 15 Sep 2022 10:21:47 +0200 From: "Arnd Bergmann" To: "Nathan Huckleberry" , nathan@kernel.org Cc: error27@gmail.com, "Greg Kroah-Hartman" , linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, llvm@lists.linux.dev, "Nick Desaulniers" , trix@redhat.com Subject: Re: [PATCH v3] staging: octeon: Fix return type of cvm_oct_xmit and cvm_oct_xmit_pow Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, 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 Wed, Sep 14, 2022, at 11:10 PM, 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 > > --- > > Changes v1 -> v2: > - Update function signatures in ethernet-tx.h. > > Changes v2 -> v3: > - Move changes below the scissors --- so they don't show in commit msg > - Add reviewed-by tag The patch looks correct to me so Acked-by: Arnd Bergmann but I have two more general comments: - For your changelogs, it would help to include the diagnostic message from smatch that you link to. - This has probably been discussed before, but why is this only reported by smatch but by clang itself when building with CFI enabled? It appears that CFI enforces stricter C++ style type compatibility on enums while the warnings only catch incompatible types according to the normal C11 rules. Arnd