Re: [PATCH v2 2/2] bootstd: Replace bootmethod(s) -> bootmeth(s)
Hi, On Sun, 16 Jun 2024 at 01:43, Heinrich Schuchardt wrote: > > On 6/4/24 17:15, Mattijs Korpershoek wrote: > > According to [1], we should use bootmeth when describing the > > struct bootmeth: > > > > """ > > For version 2, a new naming scheme is used as above: > > > > - bootdev is used instead of bootdevice, because 'device' is overused, > > is everywhere in U-Boot, can be confused with udevice > > Boot devices are udevices though they don't relate to hardware but to an > abstract concept. > > bootdev is just an abbreviation. This does not make the meaning any clearer. > > > - bootmeth - because 'method' is too vanilla, appears 1300 times in > > U-Boot > > """ > > Avoiding abbreviations like bootdev and bootmeth improved readability. I think people need to learn the terms used in the code. Having a term used consistently seems like a win to me. The documentation helps here too, e.g. [1] Reviewed-by: Simon Glass Regards, Simon [1] https://docs.u-boot.org/en/latest/develop/bootstd.html#bootmeth
Re: [PATCH v2 2/2] bootstd: Replace bootmethod(s) -> bootmeth(s)
Hi Heinrich, On 6/17/24 11:24 AM, Heinrich Schuchardt wrote: On 17.06.24 11:00, Quentin Schulz wrote: Hi all, On 6/17/24 8:31 AM, Mattijs Korpershoek wrote: Hi Heinrich, Thank you for your review. On dim., juin 16, 2024 at 09:38, Heinrich Schuchardt wrote: On 6/4/24 17:15, Mattijs Korpershoek wrote: According to [1], we should use bootmeth when describing the struct bootmeth: """ For version 2, a new naming scheme is used as above: - bootdev is used instead of bootdevice, because 'device' is overused, is everywhere in U-Boot, can be confused with udevice Boot devices are udevices though they don't relate to hardware but to an abstract concept. bootdev is just an abbreviation. This does not make the meaning any clearer. Per my understanding, the name for this concept is "bootdev", not "boot device", see: https://docs.u-boot.org/en/latest/develop/bootstd.html#introduction - bootmeth - because 'method' is too vanilla, appears 1300 times in U-Boot """ Avoiding abbreviations like bootdev and bootmeth improved readability. The above paragraph is quoted from email [1]. In this email, Simon made the choice to use bootmeth and bootdev when pushing the initial implementation. This patch just corrects the places where the older terminology (bootmethod, bootdevice) was still used. The current wording is just incorrect, so it needs to be fixed. We have two choices: use the struct/abbreviated name (bootdevice -> bootdev; bootmethod -> bootmeth) or the full name (bootdevice -> boot device; bootmethod -> boot method). The English languages has three types of compound words: solid, hyphenated, open. bootmethod, boot-method, boot method all mean the same. According to https://www.merriam-webster.com/help/faq-compound-words: "Compound nouns are usually written as one word." See also "U.S. Government Publishing Office Style Manual", chapter 6, "COMPOUNDING RULES", https://www.govinfo.gov/content/pkg/GPO-STYLEMANUAL-2000/pdf/GPO-STYLEMANUAL-2000.pdf We should avoid unnecessary abbreviations. It's too late, the abbreviations are used in code already. For documentation: https://docs.u-boot.org/en/latest/search.html?q=bootmethod_keywords=yes=default# bootmethod returns no match. https://docs.u-boot.org/en/latest/develop/bootstd.html#bootmeth https://docs.u-boot.org/en/latest/develop/expo.html#motivation https://docs.u-boot.org/en/latest/usage/cmd/bootflow.html#bootflow-list use "boot method" all other instances are of bootmeth/bootmeths instead. A little consistency here wouldn't hurt. I don't think the current wording is consistent. I am non-native, if I read bootmethod, I assume it is used with this wording in the code, but it actually isn't, it's called bootmeth. If I read "boot method" I understand a way of booting, and I will likely not grep in the source code to find how that works. If it's a NACK, please say so. Otherwise please provide clear instructions so we know the wording we should be using for this to be accepted. Cheers, Quentin
Re: [PATCH v2 2/2] bootstd: Replace bootmethod(s) -> bootmeth(s)
On 17.06.24 11:00, Quentin Schulz wrote: Hi all, On 6/17/24 8:31 AM, Mattijs Korpershoek wrote: Hi Heinrich, Thank you for your review. On dim., juin 16, 2024 at 09:38, Heinrich Schuchardt wrote: On 6/4/24 17:15, Mattijs Korpershoek wrote: According to [1], we should use bootmeth when describing the struct bootmeth: """ For version 2, a new naming scheme is used as above: - bootdev is used instead of bootdevice, because 'device' is overused, is everywhere in U-Boot, can be confused with udevice Boot devices are udevices though they don't relate to hardware but to an abstract concept. bootdev is just an abbreviation. This does not make the meaning any clearer. Per my understanding, the name for this concept is "bootdev", not "boot device", see: https://docs.u-boot.org/en/latest/develop/bootstd.html#introduction - bootmeth - because 'method' is too vanilla, appears 1300 times in U-Boot """ Avoiding abbreviations like bootdev and bootmeth improved readability. The above paragraph is quoted from email [1]. In this email, Simon made the choice to use bootmeth and bootdev when pushing the initial implementation. This patch just corrects the places where the older terminology (bootmethod, bootdevice) was still used. The current wording is just incorrect, so it needs to be fixed. We have two choices: use the struct/abbreviated name (bootdevice -> bootdev; bootmethod -> bootmeth) or the full name (bootdevice -> boot device; bootmethod -> boot method). The English languages has three types of compound words: solid, hyphenated, open. bootmethod, boot-method, boot method all mean the same. According to https://www.merriam-webster.com/help/faq-compound-words: "Compound nouns are usually written as one word." See also "U.S. Government Publishing Office Style Manual", chapter 6, "COMPOUNDING RULES", https://www.govinfo.gov/content/pkg/GPO-STYLEMANUAL-2000/pdf/GPO-STYLEMANUAL-2000.pdf We should avoid unnecessary abbreviations. Best regards Heinrich Heinrich are you suggesting we go for full name instead? board/sandbox/sandbox.env should be using bootmeth instead as that's the name of the feature? Cheers, Quentin
Re: [PATCH v2 2/2] bootstd: Replace bootmethod(s) -> bootmeth(s)
Hi all, On 6/17/24 8:31 AM, Mattijs Korpershoek wrote: Hi Heinrich, Thank you for your review. On dim., juin 16, 2024 at 09:38, Heinrich Schuchardt wrote: On 6/4/24 17:15, Mattijs Korpershoek wrote: According to [1], we should use bootmeth when describing the struct bootmeth: """ For version 2, a new naming scheme is used as above: - bootdev is used instead of bootdevice, because 'device' is overused, is everywhere in U-Boot, can be confused with udevice Boot devices are udevices though they don't relate to hardware but to an abstract concept. bootdev is just an abbreviation. This does not make the meaning any clearer. Per my understanding, the name for this concept is "bootdev", not "boot device", see: https://docs.u-boot.org/en/latest/develop/bootstd.html#introduction - bootmeth - because 'method' is too vanilla, appears 1300 times in U-Boot """ Avoiding abbreviations like bootdev and bootmeth improved readability. The above paragraph is quoted from email [1]. In this email, Simon made the choice to use bootmeth and bootdev when pushing the initial implementation. This patch just corrects the places where the older terminology (bootmethod, bootdevice) was still used. The current wording is just incorrect, so it needs to be fixed. We have two choices: use the struct/abbreviated name (bootdevice -> bootdev; bootmethod -> bootmeth) or the full name (bootdevice -> boot device; bootmethod -> boot method). Heinrich are you suggesting we go for full name instead? board/sandbox/sandbox.env should be using bootmeth instead as that's the name of the feature? Cheers, Quentin
Re: [PATCH v2 2/2] bootstd: Replace bootmethod(s) -> bootmeth(s)
Hi Heinrich, Thank you for your review. On dim., juin 16, 2024 at 09:38, Heinrich Schuchardt wrote: > On 6/4/24 17:15, Mattijs Korpershoek wrote: >> According to [1], we should use bootmeth when describing the >> struct bootmeth: >> >> """ >> For version 2, a new naming scheme is used as above: >> >> - bootdev is used instead of bootdevice, because 'device' is overused, >> is everywhere in U-Boot, can be confused with udevice > > Boot devices are udevices though they don't relate to hardware but to an > abstract concept. > > bootdev is just an abbreviation. This does not make the meaning any clearer. Per my understanding, the name for this concept is "bootdev", not "boot device", see: https://docs.u-boot.org/en/latest/develop/bootstd.html#introduction > >> - bootmeth - because 'method' is too vanilla, appears 1300 times in >> U-Boot >> """ > > Avoiding abbreviations like bootdev and bootmeth improved readability. The above paragraph is quoted from email [1]. In this email, Simon made the choice to use bootmeth and bootdev when pushing the initial implementation. This patch just corrects the places where the older terminology (bootmethod, bootdevice) was still used. So i'm a bit confused on why this patch got rejected. Is it preferable to keep two terminologies for the same concept? Thanks Mattijs [1] https://lore.kernel.org/u-boot/20211023232635.9195-1-...@chromium.org/ > > Best regards > > Heinrich > >> >> Replace all occurences in various comments for consistency. >> >> [1] https://lore.kernel.org/u-boot/20211023232635.9195-1-...@chromium.org/ >> Signed-off-by: Mattijs Korpershoek >> --- >> board/sandbox/sandbox.env | 2 +- >> boot/bootmeth-uclass.c| 2 +- >> include/bootmeth.h| 30 +++--- >> include/extlinux.h| 2 +- >> test/boot/bootflow.c | 2 +- >> test/boot/bootmeth.c | 6 +++--- >> 6 files changed, 22 insertions(+), 22 deletions(-) >> >> diff --git a/board/sandbox/sandbox.env b/board/sandbox/sandbox.env >> index a2c19702d64d..564dce78a898 100644 >> --- a/board/sandbox/sandbox.env >> +++ b/board/sandbox/sandbox.env >> @@ -10,7 +10,7 @@ eth6addr=02:00:11:22:33:47 >> ipaddr=192.0.2.1 >> >> /* >> - * These are used for distro boot which is not supported. But once >> bootmethod >> + * These are used for distro boot which is not supported. But once bootmeth >>* is provided these will be used again. >>*/ >> bootm_size=0x1000 >> diff --git a/boot/bootmeth-uclass.c b/boot/bootmeth-uclass.c >> index 1d157d54dbdd..e3475f46b34c 100644 >> --- a/boot/bootmeth-uclass.c >> +++ b/boot/bootmeth-uclass.c >> @@ -167,7 +167,7 @@ int bootmeth_setup_iter_order(struct bootflow_iter >> *iter, bool include_global) >> if (pass) >> iter->first_glob_method = upto; >> /* >> - * Get a list of bootmethods, in seq order (i.e. using >> + * Get a list of bootmeths, in seq order (i.e. using >> * aliases). There may be gaps so try to count up high >> * enough to find them all. >> */ >> diff --git a/include/bootmeth.h b/include/bootmeth.h >> index 529c4d813d82..2570d9593d49 100644 >> --- a/include/bootmeth.h >> +++ b/include/bootmeth.h >> @@ -47,7 +47,7 @@ struct bootmeth_ops { >> * This may involve reading state from the system, e.g. some data in >> * the firmware area. >> * >> - * @dev:Bootmethod device to check >> + * @dev:Bootmeth device to check >> * @buf:Buffer to place the info in (terminator must fit) >> * @maxsize:Size of buffer >> * Returns: 0 if OK, -ENOSPC is buffer is too small, other -ve error if >> @@ -74,7 +74,7 @@ struct bootmeth_ops { >> * >> * It may update only the flags in @iter >> * >> - * @dev:Bootmethod device to check against >> + * @dev:Bootmeth device to check against >> * @iter: On entry, provides bootdev, hwpart, part >> * Return: 0 if OK, -ENOTSUPP if this bootdev is not supported >> */ >> @@ -83,7 +83,7 @@ struct bootmeth_ops { >> /** >> * read_bootflow() - read a bootflow for a device >> * >> - * @dev:Bootmethod device to use >> + * @dev:Bootmeth device to use >> * @bflow: On entry, provides dev, hwpart, part and method. >> * Returns updated bootflow if found >> * Return: 0 if OK, -ve on error >> @@ -96,7 +96,7 @@ struct bootmeth_ops { >> * This provides a bootflow file to the bootmeth, to see if it is valid. >> * If it is, the bootflow is set up accordingly. >> * >> - * @dev:Bootmethod device to use >> + * @dev:Bootmeth device to use >> * @bflow: On entry, provides bootdev. >> * Returns updated bootflow if found >> * @buf:
Re: [PATCH v2 2/2] bootstd: Replace bootmethod(s) -> bootmeth(s)
On 6/4/24 17:15, Mattijs Korpershoek wrote: According to [1], we should use bootmeth when describing the struct bootmeth: """ For version 2, a new naming scheme is used as above: - bootdev is used instead of bootdevice, because 'device' is overused, is everywhere in U-Boot, can be confused with udevice Boot devices are udevices though they don't relate to hardware but to an abstract concept. bootdev is just an abbreviation. This does not make the meaning any clearer. - bootmeth - because 'method' is too vanilla, appears 1300 times in U-Boot """ Avoiding abbreviations like bootdev and bootmeth improved readability. Best regards Heinrich Replace all occurences in various comments for consistency. [1] https://lore.kernel.org/u-boot/20211023232635.9195-1-...@chromium.org/ Signed-off-by: Mattijs Korpershoek --- board/sandbox/sandbox.env | 2 +- boot/bootmeth-uclass.c| 2 +- include/bootmeth.h| 30 +++--- include/extlinux.h| 2 +- test/boot/bootflow.c | 2 +- test/boot/bootmeth.c | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/board/sandbox/sandbox.env b/board/sandbox/sandbox.env index a2c19702d64d..564dce78a898 100644 --- a/board/sandbox/sandbox.env +++ b/board/sandbox/sandbox.env @@ -10,7 +10,7 @@ eth6addr=02:00:11:22:33:47 ipaddr=192.0.2.1 /* - * These are used for distro boot which is not supported. But once bootmethod + * These are used for distro boot which is not supported. But once bootmeth * is provided these will be used again. */ bootm_size=0x1000 diff --git a/boot/bootmeth-uclass.c b/boot/bootmeth-uclass.c index 1d157d54dbdd..e3475f46b34c 100644 --- a/boot/bootmeth-uclass.c +++ b/boot/bootmeth-uclass.c @@ -167,7 +167,7 @@ int bootmeth_setup_iter_order(struct bootflow_iter *iter, bool include_global) if (pass) iter->first_glob_method = upto; /* -* Get a list of bootmethods, in seq order (i.e. using +* Get a list of bootmeths, in seq order (i.e. using * aliases). There may be gaps so try to count up high * enough to find them all. */ diff --git a/include/bootmeth.h b/include/bootmeth.h index 529c4d813d82..2570d9593d49 100644 --- a/include/bootmeth.h +++ b/include/bootmeth.h @@ -47,7 +47,7 @@ struct bootmeth_ops { * This may involve reading state from the system, e.g. some data in * the firmware area. * -* @dev:Bootmethod device to check +* @dev:Bootmeth device to check * @buf:Buffer to place the info in (terminator must fit) * @maxsize:Size of buffer * Returns: 0 if OK, -ENOSPC is buffer is too small, other -ve error if @@ -74,7 +74,7 @@ struct bootmeth_ops { * * It may update only the flags in @iter * -* @dev:Bootmethod device to check against +* @dev:Bootmeth device to check against * @iter: On entry, provides bootdev, hwpart, part * Return: 0 if OK, -ENOTSUPP if this bootdev is not supported */ @@ -83,7 +83,7 @@ struct bootmeth_ops { /** * read_bootflow() - read a bootflow for a device * -* @dev:Bootmethod device to use +* @dev:Bootmeth device to use * @bflow: On entry, provides dev, hwpart, part and method. * Returns updated bootflow if found * Return: 0 if OK, -ve on error @@ -96,7 +96,7 @@ struct bootmeth_ops { * This provides a bootflow file to the bootmeth, to see if it is valid. * If it is, the bootflow is set up accordingly. * -* @dev:Bootmethod device to use +* @dev:Bootmeth device to use * @bflow: On entry, provides bootdev. * Returns updated bootflow if found * @buf:Buffer containing the possible bootflow file @@ -111,7 +111,7 @@ struct bootmeth_ops { * * Read a file from the same place as the bootflow came from * -* @dev:Bootmethod device to use +* @dev:Bootmeth device to use * @bflow: Bootflow providing info on where to read from * @file_path: Path to file (may be absolute or relative) * @addr: Address to load file @@ -126,7 +126,7 @@ struct bootmeth_ops { /** * readall() - read all files for a bootflow * -* @dev:Bootmethod device to boot +* @dev:Bootmeth device to boot * @bflow: Bootflow to read * Return: 0 if OK, -EIO on I/O error, other -ve on other error */ @@ -135,7 +135,7 @@ struct bootmeth_ops { /** * boot() - boot a bootflow * -
Re: [PATCH v2 2/2] bootstd: Replace bootmethod(s) -> bootmeth(s)
Hi Quentin, Thank you for the review. On mar., juin 04, 2024 at 17:25, Quentin Schulz wrote: > Hi Mattijs, > > On 6/4/24 5:15 PM, Mattijs Korpershoek wrote: >> According to [1], we should use bootmeth when describing the >> struct bootmeth: >> >> """ >> For version 2, a new naming scheme is used as above: >> >> - bootdev is used instead of bootdevice, because 'device' is overused, >> is everywhere in U-Boot, can be confused with udevice >> - bootmeth - because 'method' is too vanilla, appears 1300 times in >> U-Boot >> """ >> >> Replace all occurences in various comments for consistency. >> > > s/occurences/occurrences/ Urgh, I guess I spot typos from others but not my own ones :/ > > Sorry, was too tempting to highlight a typo in a commit that fixes typos :) > > (Don't send a v3 for this please :) ) I won't. I hope the person applying this patch can do a fixup. > >> [1] https://lore.kernel.org/u-boot/20211023232635.9195-1-...@chromium.org/ > > Reviewed-by: Quentin Schulz > > Thanks! > Quentin
Re: [PATCH v2 2/2] bootstd: Replace bootmethod(s) -> bootmeth(s)
Hi Mattijs, On 6/4/24 5:15 PM, Mattijs Korpershoek wrote: According to [1], we should use bootmeth when describing the struct bootmeth: """ For version 2, a new naming scheme is used as above: - bootdev is used instead of bootdevice, because 'device' is overused, is everywhere in U-Boot, can be confused with udevice - bootmeth - because 'method' is too vanilla, appears 1300 times in U-Boot """ Replace all occurences in various comments for consistency. s/occurences/occurrences/ Sorry, was too tempting to highlight a typo in a commit that fixes typos :) (Don't send a v3 for this please :) ) [1] https://lore.kernel.org/u-boot/20211023232635.9195-1-...@chromium.org/ Reviewed-by: Quentin Schulz Thanks! Quentin
[PATCH v2 2/2] bootstd: Replace bootmethod(s) -> bootmeth(s)
According to [1], we should use bootmeth when describing the struct bootmeth: """ For version 2, a new naming scheme is used as above: - bootdev is used instead of bootdevice, because 'device' is overused, is everywhere in U-Boot, can be confused with udevice - bootmeth - because 'method' is too vanilla, appears 1300 times in U-Boot """ Replace all occurences in various comments for consistency. [1] https://lore.kernel.org/u-boot/20211023232635.9195-1-...@chromium.org/ Signed-off-by: Mattijs Korpershoek --- board/sandbox/sandbox.env | 2 +- boot/bootmeth-uclass.c| 2 +- include/bootmeth.h| 30 +++--- include/extlinux.h| 2 +- test/boot/bootflow.c | 2 +- test/boot/bootmeth.c | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/board/sandbox/sandbox.env b/board/sandbox/sandbox.env index a2c19702d64d..564dce78a898 100644 --- a/board/sandbox/sandbox.env +++ b/board/sandbox/sandbox.env @@ -10,7 +10,7 @@ eth6addr=02:00:11:22:33:47 ipaddr=192.0.2.1 /* - * These are used for distro boot which is not supported. But once bootmethod + * These are used for distro boot which is not supported. But once bootmeth * is provided these will be used again. */ bootm_size=0x1000 diff --git a/boot/bootmeth-uclass.c b/boot/bootmeth-uclass.c index 1d157d54dbdd..e3475f46b34c 100644 --- a/boot/bootmeth-uclass.c +++ b/boot/bootmeth-uclass.c @@ -167,7 +167,7 @@ int bootmeth_setup_iter_order(struct bootflow_iter *iter, bool include_global) if (pass) iter->first_glob_method = upto; /* -* Get a list of bootmethods, in seq order (i.e. using +* Get a list of bootmeths, in seq order (i.e. using * aliases). There may be gaps so try to count up high * enough to find them all. */ diff --git a/include/bootmeth.h b/include/bootmeth.h index 529c4d813d82..2570d9593d49 100644 --- a/include/bootmeth.h +++ b/include/bootmeth.h @@ -47,7 +47,7 @@ struct bootmeth_ops { * This may involve reading state from the system, e.g. some data in * the firmware area. * -* @dev:Bootmethod device to check +* @dev:Bootmeth device to check * @buf:Buffer to place the info in (terminator must fit) * @maxsize:Size of buffer * Returns: 0 if OK, -ENOSPC is buffer is too small, other -ve error if @@ -74,7 +74,7 @@ struct bootmeth_ops { * * It may update only the flags in @iter * -* @dev:Bootmethod device to check against +* @dev:Bootmeth device to check against * @iter: On entry, provides bootdev, hwpart, part * Return: 0 if OK, -ENOTSUPP if this bootdev is not supported */ @@ -83,7 +83,7 @@ struct bootmeth_ops { /** * read_bootflow() - read a bootflow for a device * -* @dev:Bootmethod device to use +* @dev:Bootmeth device to use * @bflow: On entry, provides dev, hwpart, part and method. * Returns updated bootflow if found * Return: 0 if OK, -ve on error @@ -96,7 +96,7 @@ struct bootmeth_ops { * This provides a bootflow file to the bootmeth, to see if it is valid. * If it is, the bootflow is set up accordingly. * -* @dev:Bootmethod device to use +* @dev:Bootmeth device to use * @bflow: On entry, provides bootdev. * Returns updated bootflow if found * @buf:Buffer containing the possible bootflow file @@ -111,7 +111,7 @@ struct bootmeth_ops { * * Read a file from the same place as the bootflow came from * -* @dev:Bootmethod device to use +* @dev:Bootmeth device to use * @bflow: Bootflow providing info on where to read from * @file_path: Path to file (may be absolute or relative) * @addr: Address to load file @@ -126,7 +126,7 @@ struct bootmeth_ops { /** * readall() - read all files for a bootflow * -* @dev:Bootmethod device to boot +* @dev:Bootmeth device to boot * @bflow: Bootflow to read * Return: 0 if OK, -EIO on I/O error, other -ve on other error */ @@ -135,7 +135,7 @@ struct bootmeth_ops { /** * boot() - boot a bootflow * -* @dev:Bootmethod device to boot +* @dev:Bootmeth device to boot * @bflow: Bootflow to boot * Return: does not return on success, since it should boot the * Operating System. Returns -EFAULT if that fails, -ENOTSUPP if @@ -158,7 +158,7 @@ struct bootmeth_ops { *