Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Oct 2008 19:19:26 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r183805 - head/sys/dev/mmc
Message-ID:  <200810121919.m9CJJQ2t053333@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Oct 12 19:19:26 2008
New Revision: 183805
URL: http://svn.freebsd.org/changeset/base/183805

Log:
  Use GB suffix only from 10GB instead of 1GB.
  There are lot of cards with uneven sizes and too strong rounding
  will lead to very significant rounding errors.
  
  Reviewed by:	imp@

Modified:
  head/sys/dev/mmc/mmcsd.c

Modified: head/sys/dev/mmc/mmcsd.c
==============================================================================
--- head/sys/dev/mmc/mmcsd.c	Sun Oct 12 18:49:07 2008	(r183804)
+++ head/sys/dev/mmc/mmcsd.c	Sun Oct 12 19:19:26 2008	(r183805)
@@ -148,7 +148,7 @@ mmcsd_attach(device_t dev)
 	 */
 	mb = d->d_mediasize >> 20;	/* 1MiB == 1 << 20 */
 	unit = 'M';
-	if (mb > 1024) {		/* 1GiB = 1024 MiB */
+	if (mb >= 10240) {		/* 1GiB = 1024 MiB */
 		unit = 'G';
 		mb /= 1024;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810121919.m9CJJQ2t053333>