Re: [PATCH] mmc: card: modify mmc_getgeo function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, Sep 20 2011, Girish K S wrote:
> In the earlier code the cylinder, sector and head are assigned
> independently. Current patch generates the cylinder number
> with the values of sector and head.
> This patch only makes they cylinder value to be dependent on
> the sector and head.
>
> Signed-off-by: Girish K S <girish.shivananjappa@xxxxxxxxxx>
> ---
>  drivers/mmc/card/block.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index 1ff5486..bebb13b 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -226,9 +226,10 @@ static int mmc_blk_release(struct gendisk *disk, fmode_t mode)
>  static int
>  mmc_blk_getgeo(struct block_device *bdev, struct hd_geometry *geo)
>  {
> -	geo->cylinders = get_capacity(bdev->bd_disk) / (4 * 16);
>  	geo->heads = 4;
>  	geo->sectors = 16;
> +	geo->cylinders = get_capacity(bdev->bd_disk) /
> +		(geo->heads * geo->sectors);
>  	return 0;
>  }

Thanks, pushed to mmc-next for 3.2 with a reworded commit message:

Author: Girish K S <girish.shivananjappa@xxxxxxxxxx>
Date:   Tue Sep 20 16:38:49 2011 +0530

    mmc: card: Remove duplicated constants

    Reuse heads/sectors instead of duplicating them in the cylinders
    calculation.

    Signed-off-by: Girish K S <girish.shivananjappa@xxxxxxxxxx>
    Signed-off-by: Chris Ball <cjb@xxxxxxxxxx>                    

- Chris.
-- 
Chris Ball   <cjb@xxxxxxxxxx>   <http://printf.net/>
One Laptop Per Child
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux