All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MMC: ext_csd.raw_* used in comparison but never set
@ 2011-09-23  4:25 Andrei Warkentin
  2011-09-23 21:39 ` Philip Rakity
  2011-09-24 16:14 ` Chris Ball
  0 siblings, 2 replies; 3+ messages in thread
From: Andrei Warkentin @ 2011-09-23  4:25 UTC (permalink / raw)
  To: linux-mmc; +Cc: Philip Rakity, andreiw, Andrei Warkentin

f39b2dd9d065151a04f5996656d1f27a7eb32d45 added code to
only compare read-only ext_csd fields in bus width
testing code, yet it's comparing some fields that are
never set.

The affected fields are ext_csd.raw_erased_mem_count and
ext_csd.raw_partition_support.

Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>
---
 drivers/mmc/core/mmc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 5700b1c..bb33832 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -359,6 +359,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 		 * card has the Enhanced area enabled.  If so, export enhanced
 		 * area offset and size to user by adding sysfs interface.
 		 */
+		card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT];
 		if ((ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x2) &&
 		    (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) {
 			u8 hc_erase_grp_sz =
@@ -405,6 +406,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 	if (card->ext_csd.rev >= 5)
 		card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM];
 
+	card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT];
 	if (ext_csd[EXT_CSD_ERASED_MEM_CONT])
 		card->erased_byte = 0xFF;
 	else
-- 
1.7.6.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MMC: ext_csd.raw_* used in comparison but never set
  2011-09-23  4:25 [PATCH] MMC: ext_csd.raw_* used in comparison but never set Andrei Warkentin
@ 2011-09-23 21:39 ` Philip Rakity
  2011-09-24 16:14 ` Chris Ball
  1 sibling, 0 replies; 3+ messages in thread
From: Philip Rakity @ 2011-09-23 21:39 UTC (permalink / raw)
  To: Andrei Warkentin; +Cc: linux-mmc, andreiw


Acked-by: Philip Rakity <prakity@Marvell.com>

On Sep 22, 2011, at 9:25 PM, Andrei Warkentin wrote:

> f39b2dd9d065151a04f5996656d1f27a7eb32d45 added code to
> only compare read-only ext_csd fields in bus width
> testing code, yet it's comparing some fields that are
> never set.
> 
> The affected fields are ext_csd.raw_erased_mem_count and
> ext_csd.raw_partition_support.
> 
> Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>
> ---
> drivers/mmc/core/mmc.c |    2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 5700b1c..bb33832 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -359,6 +359,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
> 		 * card has the Enhanced area enabled.  If so, export enhanced
> 		 * area offset and size to user by adding sysfs interface.
> 		 */
> +		card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT];
> 		if ((ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x2) &&
> 		    (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) {
> 			u8 hc_erase_grp_sz =
> @@ -405,6 +406,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
> 	if (card->ext_csd.rev >= 5)
> 		card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM];
> 
> +	card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT];
> 	if (ext_csd[EXT_CSD_ERASED_MEM_CONT])
> 		card->erased_byte = 0xFF;
> 	else
> -- 
> 1.7.6.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] MMC: ext_csd.raw_* used in comparison but never set
  2011-09-23  4:25 [PATCH] MMC: ext_csd.raw_* used in comparison but never set Andrei Warkentin
  2011-09-23 21:39 ` Philip Rakity
@ 2011-09-24 16:14 ` Chris Ball
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Ball @ 2011-09-24 16:14 UTC (permalink / raw)
  To: Andrei Warkentin; +Cc: linux-mmc, Philip Rakity, andreiw

Hi,

On Fri, Sep 23 2011, Andrei Warkentin wrote:
> f39b2dd9d065151a04f5996656d1f27a7eb32d45 added code to
> only compare read-only ext_csd fields in bus width
> testing code, yet it's comparing some fields that are
> never set.
>
> The affected fields are ext_csd.raw_erased_mem_count and
> ext_csd.raw_partition_support.
>
> Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>

Thanks, pushed to mmc-next for 3.2 with a stable@ tag.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-24 16:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-23  4:25 [PATCH] MMC: ext_csd.raw_* used in comparison but never set Andrei Warkentin
2011-09-23 21:39 ` Philip Rakity
2011-09-24 16:14 ` Chris Ball

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.