[U-Boot] [PATCH v3 2/3] fastboot: getvar: Refactor fastboot_*_get_part_info() usage

Sam Protsenko semen.protsenko at linaro.org
Fri Jun 14 12:41:17 UTC 2019


Hi Eugeniu,

On Fri, Jun 14, 2019 at 11:42 AM Eugeniu Rosca <erosca at de.adit-jv.com> wrote:
>
> On Thu, Jun 13, 2019 at 09:11:08PM +0300, Sam Protsenko wrote:
> [..]
> > + * Get partition number and size for any storage type.
> [..]
> > + * @return Partition number or negative value on error
> [..]
>
> I think the word 'number' should be blacklisted in the vocabulary
> of software development. It can be aliased with 'count' or 'index'
> depending on context.
>

Although I understand the possible confusion between "index"/"count"
meaning for "number" term, in this particular case I don't agree that
this should be changed to "index" (in this patch at least). Yes, we
shouldn't abuse this term (as any other term, for that matter), but I
guess "partition number" is established expression, which means
"partition index", and everybody understands that:

    $ grep -Ir 'partition number' | wc -l
    46

    $ grep -Ir 'partition index' | wc -l
    2

Similar result can be achieved when grepping in Linux kernel source
tree. Also you can see this expression used in other places, like:

    $ man fdisk | grep 'partition number'
       The partition is a device name followed by a partition number.

All that said, I agree with comment on [1], where "number" can be
really confusing.

So I hope you don't mind if we leave this as is in this patch?

Thanks!

> [1] https://marc.info/?l=linux-kernel&m=132388598809954&w=2
> [2] https://patchwork.ozlabs.org/patch/1044151/#2108815
>
> --
> Best Regards,
> Eugeniu.


More information about the U-Boot mailing list