Skip to content

Commit

Permalink
[POWERPC] Fix viodasd geometry calculations
Browse files Browse the repository at this point in the history
Commit a885c8c 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 <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Stephen Rothwell authored and Paul Mackerras committed Jul 10, 2007
1 parent b8ce227 commit 36a7003
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/block/viodasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 36a7003

Please sign in to comment.