Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757098AbYHaSzM (ORCPT ); Sun, 31 Aug 2008 14:55:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755484AbYHaSy5 (ORCPT ); Sun, 31 Aug 2008 14:54:57 -0400 Received: from server.drzeus.cx ([85.8.24.28]:53079 "EHLO smtp.drzeus.cx" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754808AbYHaSy4 (ORCPT ); Sun, 31 Aug 2008 14:54:56 -0400 Date: Sun, 31 Aug 2008 20:54:48 +0200 From: Pierre Ossman To: James Bottomley Cc: Matthew Wilcox , Simon Arlott , Linux Kernel Mailing List , linux-scsi Subject: [PATCH] mmc_block: use generic helper to print capacities Message-ID: <20080831205448.5b23507d@mjolnir.drzeus.cx> In-Reply-To: <1220195634.4021.9.camel@localhost.localdomain> References: <48B9546B.4010004@simon.arlott.org.uk> <1220117091.3615.3.camel@localhost.localdomain> <20080830174516.GD1239@parisc-linux.org> <48B9B552.8060406@simon.arlott.org.uk> <48B9B588.7060709@simon.arlott.org.uk> <1220147947.3615.18.camel@localhost.localdomain> <20080831025412.GJ1239@parisc-linux.org> <1220195310.4021.4.camel@localhost.localdomain> <1220195634.4021.9.camel@localhost.localdomain> X-Mailer: Claws Mail 3.4.0 (GTK+ 2.13.7; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=PGP-SHA1; boundary="=_freyr.drzeus.cx-27280-1220208895-0001-2" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2632 Lines: 81 This is a MIME-formatted message. If you see this text it means that your E-mail software does not support MIME-formatted messages. --=_freyr.drzeus.cx-27280-1220208895-0001-2 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable From: Pierre Ossman Signed-off-by: Pierre Ossman --- diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 62a4c91..dad8edb 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -29,6 +29,7 @@ #include #include #include +#include =20 #include #include @@ -496,6 +497,8 @@ static int mmc_blk_probe(struct mmc_card *card) struct mmc_blk_data *md; int err; =20 + char cap_str[10]; + /* * Check that the card supports the command class(es) we need. */ @@ -510,10 +513,11 @@ static int mmc_blk_probe(struct mmc_card *card) if (err) goto out; =20 - printk(KERN_INFO "%s: %s %s %lluKiB %s\n", + string_get_size(get_capacity(md->disk) << 9, STRING_UNITS_2, + cap_str, sizeof(cap_str)); + printk(KERN_INFO "%s: %s %s %s %s\n", md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), - (unsigned long long)(get_capacity(md->disk) >> 1), - md->read_only ? "(ro)" : ""); + cap_str, md->read_only ? "(ro)" : ""); =20 mmc_set_drvdata(card, md); add_disk(md->disk); --=20 -- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org rdesktop, core developer http://www.rdesktop.org WARNING: This correspondence is being monitored by the Swedish government. Make sure your server uses encryption for SMTP traffic and consider using PGP for end-to-end encryption. --=_freyr.drzeus.cx-27280-1220208895-0001-2 Content-Type: application/pgp-signature; name="signature.asc" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAki66PwACgkQ7b8eESbyJLhZWwCfb3D89aa4WJz8tnEtU/2NuPCR 7/4Anj/91OnqfPFeWsOjgNsRyyzyzTlE =ajmH -----END PGP SIGNATURE----- --=_freyr.drzeus.cx-27280-1220208895-0001-2-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/