Skip to content

Commit 5696fa3

Browse files
committed
Clarify a comment in dmi_memory_device_extended_size
Improve the comment to avoid the confusion as reported in bug #48723: http://savannah.nongnu.org/bugs/?48723
1 parent 7461463 commit 5696fa3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dmidecode.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2277,7 +2277,10 @@ static void dmi_memory_device_extended_size(u32 code)
22772277
{
22782278
code &= 0x7FFFFFFFUL;
22792279

2280-
/* Use the most suitable unit depending on size */
2280+
/*
2281+
* Use the greatest unit for which the exact value can be displayed
2282+
* as an integer without rounding
2283+
*/
22812284
if (code & 0x3FFUL)
22822285
printf(" %lu MB", (unsigned long)code);
22832286
else if (code & 0xFFFFFUL)

0 commit comments

Comments
 (0)