diff mbox series

[3/3] mmc-utils: do not hide CID manufacturer information

Message ID 20230522214818.2038252-3-ejo@pengutronix.de
State New
Headers show
Series [1/3] mmc-utils: add SanDisk to manufacturer database | expand

Commit Message

Enrico Jorns May 22, 2023, 9:48 p.m. UTC
Reading the MID just to convert it to 'Unlisted' is quite unhelpful for
an info command.
Due to the (constantly increasing) amount of valid MIDs it is quite
unlikely to we have it in the database already anyway.

Thus simply always print the manufacturer ID as 0xNN and understand the
manufacturer name as an additional information held in parenthesis.

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
---
 lsmmc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Avri Altman May 24, 2023, 6:48 a.m. UTC | #1
> Reading the MID just to convert it to 'Unlisted' is quite unhelpful for an info
> command.
> Due to the (constantly increasing) amount of valid MIDs it is quite unlikely to
> we have it in the database already anyway.
> 
> Thus simply always print the manufacturer ID as 0xNN and understand the
> manufacturer name as an additional information held in parenthesis.
> 
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Reviewed-by: Avri Altman <avri.altman@wdc.com>

> ---
>  lsmmc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lsmmc.c b/lsmmc.c
> index cea43af..54c3167 100644
> --- a/lsmmc.c
> +++ b/lsmmc.c
> @@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)
>                 printf("\tCRC: 0x%02x\n", crc);
>         } else {
>                 if (config->mmc_ids[mid])
> -                       printf("manufacturer: '%s' 0x%01x\n",
> -                              config->mmc_ids[mid], oid);
> +                       printf("manufacturer: 0x%02x (%s) oid: 0x%01x\n",
> +                              mid, config->mmc_ids[mid], oid);
>                 else
> -                       printf("manufacturer: 'Unlisted' 0x%01x\n", oid);
> +                       printf("manufacturer: 0x%02x (Unlisted) oid:
> + 0x%01x\n", mid, oid);
> 
>                 printf("product: '%s' %u.%u\n", pnm, prv_major, prv_minor);
>                 printf("serial: 0x%08x\n", psn);
> --
> 2.39.2
Ulf Hansson May 24, 2023, 3:15 p.m. UTC | #2
On Mon, 22 May 2023 at 23:49, Enrico Jorns <ejo@pengutronix.de> wrote:
>
> Reading the MID just to convert it to 'Unlisted' is quite unhelpful for
> an info command.
> Due to the (constantly increasing) amount of valid MIDs it is quite
> unlikely to we have it in the database already anyway.
>
> Thus simply always print the manufacturer ID as 0xNN and understand the
> manufacturer name as an additional information held in parenthesis.
>
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>

Applied to git.kernel.org/pub/scm/utils/mmc/mmc-utils.git master, thanks!

Kind regards
Uffe


> ---
>  lsmmc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lsmmc.c b/lsmmc.c
> index cea43af..54c3167 100644
> --- a/lsmmc.c
> +++ b/lsmmc.c
> @@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)
>                 printf("\tCRC: 0x%02x\n", crc);
>         } else {
>                 if (config->mmc_ids[mid])
> -                       printf("manufacturer: '%s' 0x%01x\n",
> -                              config->mmc_ids[mid], oid);
> +                       printf("manufacturer: 0x%02x (%s) oid: 0x%01x\n",
> +                              mid, config->mmc_ids[mid], oid);
>                 else
> -                       printf("manufacturer: 'Unlisted' 0x%01x\n", oid);
> +                       printf("manufacturer: 0x%02x (Unlisted) oid: 0x%01x\n", mid, oid);
>
>                 printf("product: '%s' %u.%u\n", pnm, prv_major, prv_minor);
>                 printf("serial: 0x%08x\n", psn);
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/lsmmc.c b/lsmmc.c
index cea43af..54c3167 100644
--- a/lsmmc.c
+++ b/lsmmc.c
@@ -636,10 +636,10 @@  void print_mmc_cid(struct config *config, char *cid)
 		printf("\tCRC: 0x%02x\n", crc);
 	} else {
 		if (config->mmc_ids[mid])
-			printf("manufacturer: '%s' 0x%01x\n",
-			       config->mmc_ids[mid], oid);
+			printf("manufacturer: 0x%02x (%s) oid: 0x%01x\n",
+			       mid, config->mmc_ids[mid], oid);
 		else
-			printf("manufacturer: 'Unlisted' 0x%01x\n", oid);
+			printf("manufacturer: 0x%02x (Unlisted) oid: 0x%01x\n", mid, oid);
 
 		printf("product: '%s' %u.%u\n", pnm, prv_major, prv_minor);
 		printf("serial: 0x%08x\n", psn);