From: Stephen Rothwell Date: Tue, 29 May 2007 06:06:54 +0000 (+1000) Subject: [POWERPC] Fix viodasd geometry calculations X-Git-Tag: v2.6.23-rc1~767^2^2~34 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36a700307ece3ca090d1f8f071db085087ddc627;p=linux-2.6 [POWERPC] Fix viodasd geometry calculations Commit a885c8c4316e1c1d2d2c8755da3f3d14f852528d that introduced the getgeo block device method changed the fallback number of sectors and introduced a bug into the fallback cylinder number calculation. Thanks to Rusty Russell for noticing this. Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index 68592c3360..dae39911a1 100644 --- a/drivers/block/viodasd.c +++ b/drivers/block/viodasd.c @@ -252,10 +252,10 @@ static int viodasd_getgeo(struct block_device *bdev, struct hd_geometry *geo) struct gendisk *disk = bdev->bd_disk; struct viodasd_device *d = disk->private_data; - geo->sectors = d->sectors ? d->sectors : 0; + geo->sectors = d->sectors ? d->sectors : 32; geo->heads = d->tracks ? d->tracks : 64; geo->cylinders = d->cylinders ? d->cylinders : - get_capacity(disk) / (geo->cylinders * geo->heads); + get_capacity(disk) / (geo->sectors * geo->heads); return 0; }