From: Greg KH <gregkh@linuxfoundation.org>
To: Joshua Jayasingh <joshuajayasingh08@gmail.com>
Cc: groeck@chromium.org, chrome-platform@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Subject: [PATCH] firmware: google: Add comments to coreboot_table.c
Date: Sun, 21 Sep 2025 15:35:07 +0200 [thread overview]
Message-ID: <2025092130-caliber-hypocrisy-5742@gregkh> (raw)
In-Reply-To: <20250921132446.1974-1-joshuajayasingh08@gmail.com>
On Sun, Sep 21, 2025 at 06:54:46PM +0530, Joshua Jayasingh wrote:
> The coreboot_table.c file contains no comments, making it difficult
> for new developers to understand the logic for parsing the coreboot
> tables and locating firmware entries.
Nit, your Subject: line has "Subject" in it again :)
> This patch adds comprehensive comments throughout the file, explaining
> the purpose of key functions, structs, and complex operations to improve
> overall readability and maintainability.
>
> Signed-off-by: Joshua Jayasingh <joshuajayasingh08@gmail.com>
> ---
> drivers/firmware/google/coreboot_table.c | 187 +++++++++++++++++++++--
> 1 file changed, 177 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/google/coreboot_table.c
> index 882db32e51be..d78038bd069f 100644
> --- a/drivers/firmware/google/coreboot_table.c
> +++ b/drivers/firmware/google/coreboot_table.c
> @@ -2,7 +2,11 @@
> /*
> * coreboot_table.c
> *
> - * Module providing coreboot table access.
> + * Module providing coreboot table access. This module creates a new bus type
> + * ("coreboot") and a platform driver. The driver finds the coreboot table in
> + * memory (via ACPI or Device Tree), parses it, and creates a new device on the
> + * coreboot bus for each entry in the table. Other drivers can then register
> + * with the coreboot bus to interact with these specific entries.
> *
> * Copyright 2017 Google Inc.
> * Copyright 2017 Samuel Holland <samuel@sholland.org>
> @@ -21,26 +25,52 @@
>
> #include "coreboot_table.h"
>
> +/* Helper macro to get the coreboot_device from a struct device. */
> #define CB_DEV(d) container_of(d, struct coreboot_device, dev)
> +/* Helper macro to get the coreboot_driver from a const struct device_driver. */
> #define CB_DRV(d) container_of_const(d, struct coreboot_driver, drv)
Close, but not quiet correct documentation for this last macro. Why do
you think that it has to be "const"? It should work without it, right?
> +/**
> + * coreboot_bus_match - Match a coreboot device with a coreboot driver.
> + * @dev: The coreboot device.
> + * @drv: The coreboot device driver.
> + *
> + * This function is called by the driver core to determine if a driver can
> + * handle a specific device. It iterates through the driver's ID table and
> + * compares the coreboot entry tag of the device with the tags supported by
> + * the driver.
> + *
> + * Return: 1 if the device's tag matches an ID in the driver's table,
> + * 0 otherwise.
> + */
> static int coreboot_bus_match(struct device *dev, const struct device_driver *drv)
Why are you documenting static functions that do "obvious" things?
I'm all for documenting stuff, but why do all of this to this old
driver? Where did this documentation come from? Was it generated by a
tool?
thanks,
greg k-h
next prev parent reply other threads:[~2025-09-21 13:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-21 13:24 [PATCH] Subject: [PATCH] firmware: google: Add comments to coreboot_table.c Joshua Jayasingh
2025-09-21 13:35 ` Greg KH [this message]
2025-09-21 15:54 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2025092130-caliber-hypocrisy-5742@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=chrome-platform@lists.linux.dev \
--cc=groeck@chromium.org \
--cc=joshuajayasingh08@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox