Re: [patch 1/1] dm: fix printk errors about whether %lu/%Lu isright for sector_t - revised

From: Andrew Morton
Date: Mon Oct 25 2004 - 16:55:35 EST


BlaisorBlade <blaisorblade_spam@xxxxxxxx> wrote:
>
> > I'd much prefer that you simply remove SECTOR_FORMAT completely.
>
> Impossible - doing a scanf and then copying the value is much uglier.

Put this in ll_rw_blk.c:

/*
* Parse an ascii decimal number into a sector_t. Return 1 on success
*/
int str_to_sector_t(const char *str, sector_t *sector)
{
unsigned long long val;
int ret;

ret = sscanf(str, "%llu", &val);
if (ret == 1)
*sector = val;
return ret;
}
EXPORT_SYMBOL(str_to_sector_t);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/