LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* MMC: logical-bitwise and confusion in  tifm_sd_transfer_data()?
@ 2008-03-09 20:31 Roel Kluin
  2008-03-10 12:56 ` Pierre Ossman
  0 siblings, 1 reply; 5+ messages in thread
From: Roel Kluin @ 2008-03-09 20:31 UTC (permalink / raw)
  To: drzeus-mmc; +Cc: lkml

from drivers/mmc/host/tifm_sd.c:183:

if ((r_data->flags & MMC_DATA_WRITE)
    && DATA_CARRY)

shouldn't this be bit-wise &?

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

* Re: MMC: logical-bitwise and confusion in  tifm_sd_transfer_data()?
  2008-03-09 20:31 MMC: logical-bitwise and confusion in tifm_sd_transfer_data()? Roel Kluin
@ 2008-03-10 12:56 ` Pierre Ossman
  2008-03-11  7:40   ` Alex Dubov
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Ossman @ 2008-03-10 12:56 UTC (permalink / raw)
  To: Roel Kluin, Alex Dubov; +Cc: lkml

On Sun, 09 Mar 2008 21:31:08 +0100
Roel Kluin <12o3l@tiscali.nl> wrote:

> from drivers/mmc/host/tifm_sd.c:183:
> 
> if ((r_data->flags & MMC_DATA_WRITE)
>     && DATA_CARRY)
> 
> shouldn't this be bit-wise &?

First off, I'm not the maintainer of that driver, Alex Dubov is.

Second, the code seems broken, but not in the way you suggest. It should probably have been:

if ((r_data->flags & MMC_DATA_WRITE)
	&& (host->cmd_flags & DATA_CARRY))

Alex, could you have a look?

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org

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

* Re: MMC: logical-bitwise and confusion in  tifm_sd_transfer_data()?
  2008-03-10 12:56 ` Pierre Ossman
@ 2008-03-11  7:40   ` Alex Dubov
  2008-03-11  8:00     ` [PATCH] MMC: DATA_CARRY is not boolean in tifm_sd_transfer_data() (was: MMC: logical-bitwise and confusion in tifm_sd_transfer_data()?) Roel Kluin
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Dubov @ 2008-03-11  7:40 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: lkml, Roel Kluin


--- Pierre Ossman <drzeus-mmc@drzeus.cx> wrote:

> On Sun, 09 Mar 2008 21:31:08 +0100
> Roel Kluin <12o3l@tiscali.nl> wrote:
> 
> > from drivers/mmc/host/tifm_sd.c:183:
> > 
> > if ((r_data->flags & MMC_DATA_WRITE)
> >     && DATA_CARRY)
> > 
> > shouldn't this be bit-wise &?
> 
> First off, I'm not the maintainer of that driver, Alex Dubov is.
> 
> Second, the code seems broken, but not in the way you suggest. It should probably have been:
> 
> if ((r_data->flags & MMC_DATA_WRITE)
> 	&& (host->cmd_flags & DATA_CARRY))
> 

Yes, this is the intended meaning. Can you fix it yourself or should I send a separate patch?



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping

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

* [PATCH] MMC: DATA_CARRY is not boolean in tifm_sd_transfer_data() (was: MMC: logical-bitwise and confusion in  tifm_sd_transfer_data()?)
  2008-03-11  7:40   ` Alex Dubov
@ 2008-03-11  8:00     ` Roel Kluin
  2008-03-15 15:01       ` Pierre Ossman
  0 siblings, 1 reply; 5+ messages in thread
From: Roel Kluin @ 2008-03-11  8:00 UTC (permalink / raw)
  To: Alex Dubov; +Cc: Pierre Ossman, lkml

Alex Dubov wrote:
> --- Pierre Ossman <drzeus-mmc@drzeus.cx> wrote:
> 
>> On Sun, 09 Mar 2008 21:31:08 +0100
>> Roel Kluin <12o3l@tiscali.nl> wrote:
>>
>>> from drivers/mmc/host/tifm_sd.c:183:
>>>
>>> if ((r_data->flags & MMC_DATA_WRITE)
>>>     && DATA_CARRY)
>>>
>>> shouldn't this be bit-wise &?
>> First off, I'm not the maintainer of that driver, Alex Dubov is.
>>
>> Second, the code seems broken, but not in the way you suggest. It should probably have been:
>>
>> if ((r_data->flags & MMC_DATA_WRITE)
>> 	&& (host->cmd_flags & DATA_CARRY))
>>
> 
> Yes, this is the intended meaning. Can you fix it yourself or should I send a separate patch?

Thanks,
---
DATA_CARRY is not boolean

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/mmc/host/tifm_sd.c b/drivers/mmc/host/tifm_sd.c
index 20d5c7b..1c14a18 100644
--- a/drivers/mmc/host/tifm_sd.c
+++ b/drivers/mmc/host/tifm_sd.c
@@ -180,7 +180,7 @@ static void tifm_sd_transfer_data(struct tifm_sd *host)
 			host->sg_pos++;
 			if (host->sg_pos == host->sg_len) {
 				if ((r_data->flags & MMC_DATA_WRITE)
-				    && DATA_CARRY)
+				    && (host->cmd_flags & DATA_CARRY))
 					writel(host->bounce_buf_data[0],
 					       host->dev->addr
 					       + SOCK_MMCSD_DATA);

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

* Re: [PATCH] MMC: DATA_CARRY is not boolean in tifm_sd_transfer_data() (was: MMC: logical-bitwise and confusion in  tifm_sd_transfer_data()?)
  2008-03-11  8:00     ` [PATCH] MMC: DATA_CARRY is not boolean in tifm_sd_transfer_data() (was: MMC: logical-bitwise and confusion in tifm_sd_transfer_data()?) Roel Kluin
@ 2008-03-15 15:01       ` Pierre Ossman
  0 siblings, 0 replies; 5+ messages in thread
From: Pierre Ossman @ 2008-03-15 15:01 UTC (permalink / raw)
  To: Roel Kluin; +Cc: Alex Dubov, lkml

On Tue, 11 Mar 2008 09:00:41 +0100
Roel Kluin <12o3l@tiscali.nl> wrote:

> Alex Dubov wrote:
> > 
> > Yes, this is the intended meaning. Can you fix it yourself or should I send a separate patch?
> 
> Thanks,
> ---
> DATA_CARRY is not boolean
> 
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
> ---

Sorry about the delay. I've sent this off to Linus now.

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org

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

end of thread, other threads:[~2008-03-15 15:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-09 20:31 MMC: logical-bitwise and confusion in tifm_sd_transfer_data()? Roel Kluin
2008-03-10 12:56 ` Pierre Ossman
2008-03-11  7:40   ` Alex Dubov
2008-03-11  8:00     ` [PATCH] MMC: DATA_CARRY is not boolean in tifm_sd_transfer_data() (was: MMC: logical-bitwise and confusion in tifm_sd_transfer_data()?) Roel Kluin
2008-03-15 15:01       ` Pierre Ossman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).