dmidecode-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [dmidecode] Memory voltage values


From: Erwan Velu
Subject: Re: [dmidecode] Memory voltage values
Date: Wed, 24 Apr 2013 15:11:10 +0200

Hey Jean,

I do see many devices using 1.xy voltage like 1.35, 1.55, 1.65 etc...
So we could easily image that something thinks the device runs at 1.5 while
it's 1.55.

I do agree 3 digits is too much, 1 is maybe not enough.

SMBIOS 2.8 doesn't provide any min/max for this minivolt value, so we can
expect having 2 sub digits easily.

My 2 cents,


2013/4/23 Jean Delvare <address@hidden>

> Since SMBIOS 2.8.0, dmidecode can display memory voltage values. Values
> are stored in mV and the code currently uses %.3f to print the value in
> volts. This means that the standard DDR3 voltage would be displayed as
> "1.500 V". 3 decimal places seem a bit overkill in most situations. I
> think "1.5 V" would look better and be closer to what the reader would
> expect. So I'd rather use %g so that the trailing 0s are omitted. The
> only problematic corner case would be multiples of 1000, which would be
> printed as "1 V", "2 V" etc. which is a bit rough and unexpected. So I
> would force one decimal for these.
>
> This can be easily achieved with the following code change:
>
> --- dmidecode.orig/dmidecode.c  2013-04-23 16:41:14.844319737 +0200
> +++ dmidecode/dmidecode.c       2013-04-23 21:50:04.320649702 +0200
> @@ -2236,7 +2236,7 @@ static void dmi_memory_voltage_value(u16
>         if (code == 0)
>                 printf(" Unknown");
>         else
> -               printf(" %.3f V", (float)code / 1000);
> +               printf(code % 100 ? " %g V" : " %.1f V", (float)code /
> 1000);
>  }
>
>  static const char *dmi_memory_device_form_factor(u8 code)
>
> Anton, what do you think?
>
> --
> Jean Delvare
>
> _______________________________________________
> https://lists.nongnu.org/mailman/listinfo/dmidecode-devel
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]