Re: [PATCH] mmc_block: use generic helper to print capacities

Pierre Ossman
2008-09-06T08:58:21Z

[-- Attachment #1: Type: text/plain, Size: 1921 bytes --]

On Fri, 05 Sep 2008 16:03:54 -0500
James Bottomley <James.Bottomley@HansenPartnership.com> wrote:

>
> Oh ... your inline attached patch is actually whitespace broken (it has
> spaces for tabs), which is why it doesn't apply. Sorry, that's the
> first thing I usually check, I just skipped it in your case. Could you
> resend it as an attachment?
>

What the... It seems someone broke git-diff (or less). This one is
properly undamaged:

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 <linux/blkdev.h>
#include <linux/mutex.h>
#include <linux/scatterlist.h>
+#include <linux/string_helpers.h>

#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
@@ -496,6 +497,8 @@ static int mmc_blk_probe(struct mmc_card *card)
struct mmc_blk_data *md;
int err;

+ 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;

- 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)" : "");

mmc_set_drvdata(card, md);
add_disk(md->disk);

--
-- 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]