Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp393761rdb; Tue, 5 Dec 2023 08:13:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IG8qFSHBchLftMdYZ2AxILcrFFu99lbjwSIgQa3LxHUbvfQdMqujTkgqoHc5IQV779WmMeb X-Received: by 2002:a17:90a:ec10:b0:286:bee4:5594 with SMTP id l16-20020a17090aec1000b00286bee45594mr1152404pjy.53.1701792820636; Tue, 05 Dec 2023 08:13:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701792820; cv=none; d=google.com; s=arc-20160816; b=o3bEieXwTm4tXZONdyaP5sfY4OO46C+wdW6xaWt4b0SzK4SNgShsfWM5NFqaTwXgqa xJkhrBCnsa/n/RbpTMGoyfnBAkKelqbujeMWVQaQKXYmZRTkgqpFSA1P6Bg4Jq6f+f/Q eFMqPyxYh+9w7xJPW/YnNN8YY1FlI12+PTHmzBMqJW7O1jukYqw+fdI+XcVmXi/C8o/A dbyrTFKJoCGQIesDgK+xc8TzmL6KCuTd43noWiwHriwp8zpXdT82t2Ba2pzwd1kzYNjh svkhMisJb0NzurVHZuNjF9qPe6wBzKfXNqYgXqZOkYWR5NCLCBDx+d9f9rmdFGczhYbj BlrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=THp6AM1jcLyHUTnm/h+Y/YUEnvKm98jy5/H5R+R154E=; fh=rtG1AAlMP2foo741Ho4V9wKMtABx19AM1KaGQZYbjMk=; b=JUJGkoyglnRNItCpFAs0CBunAz7ANhxQY8VaKIZToJDVPnHNuCFOJC3E0tegDxIU3P bBo8II6m0brxeje5usqRugFhGy1rmIHZE8Z6Vta06Jy73RvGqmyXcuPoSs3kDJwQ7f2T YGa3Li6bbG7qji4h20hoOSB/IVK9WIjHg1VSFNmSA6g6Ciek/WUYHUz8D9DK0MG3ytBl 6Zmzzx0R7zDzbAhCx+iJoM6dTYdZzd/7V0gRththUJlsW3LvzcF6uVciX5RJysOmzQ8H tL/vUSJYyfRi7j5rvBQFpLlsVxugpRnaLiN8ZFJ6kTgpyJQDay6vj5RhMRKSuHaT/dmZ UPVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Fb69uvI9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id q4-20020a17090a9f4400b002868fb621f0si4798015pjv.67.2023.12.05.08.13.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 08:13:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Fb69uvI9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 047428095F40; Tue, 5 Dec 2023 08:11:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232244AbjLEQLb (ORCPT + 99 others); Tue, 5 Dec 2023 11:11:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231833AbjLEQLa (ORCPT ); Tue, 5 Dec 2023 11:11:30 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C0C7109; Tue, 5 Dec 2023 08:11:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=THp6AM1jcLyHUTnm/h+Y/YUEnvKm98jy5/H5R+R154E=; b=Fb69uvI9/RnLxQ/D/W6f/XnmiI jXhNhBtB8mD4Ra7sSeTMyjvPPN8MBfdbQ/aRZLBRkllP+i372I57c6mICaLB0hKZwyNETFlXt2huT RWuzvwgYWTQ/tebIoOZ+2elOeOqRrRGGQRaPkn8s94fEFQuog3h4/eYAAbOB0GbN3dv0RmXjLMADt 3spKhwFeOPkIYxrUPMc5EDsfqJQ6wNkYZtAbz/iLMFb0PQ37fdGb/dQnJxu20+k/iAI9iuNzVw6kU ygac7NilbggzEBKExscLqw4UQZ+41yT7EMwJXlbSqVof2XxzHk++lyoJGcG+UjSTZ69mZnQ+sRVH9 8+WmxaUQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:56634) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rAY18-00072j-0O; Tue, 05 Dec 2023 16:11:26 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rAY18-0001r9-G9; Tue, 05 Dec 2023 16:11:26 +0000 Date: Tue, 5 Dec 2023 16:11:26 +0000 From: "Russell King (Oracle)" To: Jakub Kicinski Cc: Andrew Lunn , Christian Marangi , Florian Fainelli , Broadcom internal kernel review list , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Paolo Abeni , David Epping , Vladimir Oltean , Harini Katakam , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, workflows@vger.kernel.org Subject: Re: [net-next PATCH v3 3/3] net: phy: add support for PHY package MMD read/write Message-ID: References: <20231128133630.7829-1-ansuelsmth@gmail.com> <20231128133630.7829-3-ansuelsmth@gmail.com> <20231204181752.2be3fd68@kernel.org> <51aae9d0-5100-41af-ade0-ecebeccbc418@lunn.ch> <656f37a6.5d0a0220.96144.356f@mx.google.com> <20231205072912.2d79a1d5@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231205072912.2d79a1d5@kernel.org> Sender: Russell King (Oracle) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 05 Dec 2023 08:11:47 -0800 (PST) On Tue, Dec 05, 2023 at 07:29:12AM -0800, Jakub Kicinski wrote: > On Tue, 5 Dec 2023 15:10:50 +0000 Russell King (Oracle) wrote: > > I've raised this before in other subsystems, and it's suggested that > > it's better to have it in the .c file. I guess the reason is that it's > > more obvious that the function is documented when modifying it, so > > there's a higher probability that the kdoc will get updated when the > > function is altered. > > Plus I think people using IDEs (i.e. not me) may use the "jump to > definition" functionality, to find the doc? > > TBH I thought putting kdoc in the C source was documented in the coding > style, but I can't find any mention of it now. Well, in Documentation/doc-guide/kernel-doc.rst: The function and type kernel-doc comments should be placed just before the function or type being described in order to maximise the chance that somebody changing the code will also change the documentation. That implies (but not explicitly) that it should be at the function definition site, since "changing the code" is used as an argument as I did in my previous email. Secondly, this document goes on to give an example of running scripts/kernel-doc on a .c file. Thirdly, there are seven references in this document of kernel-doc in .c files, and only one for kernel-doc in a .h file. So this suggests that "it will be in a .c file" isn't a rule (it can't be because of documenting structures!) So let's not get hung up on whether it should be in .c or .h because I think that isn't relevant. Instead, I think it's about "it should be at the definition site" - that being a structure definition or a function definition, and not at a function prototype. The only exception I can think of is the style I've used in linux/phylink.h for the _method_ definitions which look like function prototypes - that's just a work-around because one can't kernel-doc the structure-of-function-pointers and document the function parameters without jumping through that hoop, and it would be silly to document the methods in some random driver! -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!