* [patch] mmc: sdhci-bcm-kona: '|' vs '&' typo
@ 2013-08-21 8:24 Dan Carpenter
2013-08-21 8:57 ` walter harms
2013-08-21 14:30 ` Christian Daudt
0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2013-08-21 8:24 UTC (permalink / raw)
To: Chris Ball
Cc: Grant Likely, Rob Herring, Christian Daudt, Arnd Bergmann,
linux-mmc, devicetree, kernel-janitors
The intent was to test if a flag was set. In the current code the
conditions are always true.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static checker stuff. Untested.
diff --git a/drivers/mmc/host/sdhci-bcm-kona.c b/drivers/mmc/host/sdhci-bcm-kona.c
index 87175f9..9ffac0b 100644
--- a/drivers/mmc/host/sdhci-bcm-kona.c
+++ b/drivers/mmc/host/sdhci-bcm-kona.c
@@ -263,7 +263,7 @@ static int __init sdhci_bcm_kona_probe(struct platform_device *pdev)
(mmc_gpio_get_cd(host->mmc) != -ENOSYS) ? 'Y' : 'N',
(mmc_gpio_get_ro(host->mmc) != -ENOSYS) ? 'Y' : 'N');
- if (host->mmc->caps | MMC_CAP_NONREMOVABLE)
+ if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
dev_dbg(dev, "is_8bit=%c\n",
@@ -282,7 +282,7 @@ static int __init sdhci_bcm_kona_probe(struct platform_device *pdev)
}
/* if device is eMMC, emulate card insert right here */
- if (host->mmc->caps | MMC_CAP_NONREMOVABLE) {
+ if (host->mmc->caps & MMC_CAP_NONREMOVABLE) {
ret = sdhci_bcm_kona_sd_card_emulate(host, 1);
if (ret) {
dev_err(dev,
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [patch] mmc: sdhci-bcm-kona: '|' vs '&' typo
2013-08-21 8:24 [patch] mmc: sdhci-bcm-kona: '|' vs '&' typo Dan Carpenter
@ 2013-08-21 8:57 ` walter harms
2013-08-21 9:14 ` Dan Carpenter
2013-08-21 14:30 ` Christian Daudt
1 sibling, 1 reply; 4+ messages in thread
From: walter harms @ 2013-08-21 8:57 UTC (permalink / raw)
To: Dan Carpenter
Cc: Chris Ball, Grant Likely, Rob Herring, Christian Daudt,
Arnd Bergmann, linux-mmc, devicetree, kernel-janitors
Am 21.08.2013 10:24, schrieb Dan Carpenter:
> The intent was to test if a flag was set. In the current code the
> conditions are always true.
I guess that it worked before ...
That leaves the Question: are the tests needed at all ?
re,
wh
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Static checker stuff. Untested.
>
> diff --git a/drivers/mmc/host/sdhci-bcm-kona.c b/drivers/mmc/host/sdhci-bcm-kona.c
> index 87175f9..9ffac0b 100644
> --- a/drivers/mmc/host/sdhci-bcm-kona.c
> +++ b/drivers/mmc/host/sdhci-bcm-kona.c
> @@ -263,7 +263,7 @@ static int __init sdhci_bcm_kona_probe(struct platform_device *pdev)
> (mmc_gpio_get_cd(host->mmc) != -ENOSYS) ? 'Y' : 'N',
> (mmc_gpio_get_ro(host->mmc) != -ENOSYS) ? 'Y' : 'N');
>
> - if (host->mmc->caps | MMC_CAP_NONREMOVABLE)
> + if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
> host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
>
> dev_dbg(dev, "is_8bit=%c\n",
> @@ -282,7 +282,7 @@ static int __init sdhci_bcm_kona_probe(struct platform_device *pdev)
> }
>
> /* if device is eMMC, emulate card insert right here */
> - if (host->mmc->caps | MMC_CAP_NONREMOVABLE) {
> + if (host->mmc->caps & MMC_CAP_NONREMOVABLE) {
> ret = sdhci_bcm_kona_sd_card_emulate(host, 1);
> if (ret) {
> dev_err(dev,
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch] mmc: sdhci-bcm-kona: '|' vs '&' typo
2013-08-21 8:57 ` walter harms
@ 2013-08-21 9:14 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2013-08-21 9:14 UTC (permalink / raw)
To: walter harms
Cc: Chris Ball, Grant Likely, Rob Herring, Christian Daudt,
Arnd Bergmann, linux-mmc, devicetree, kernel-janitors
On Wed, Aug 21, 2013 at 10:57:57AM +0200, walter harms wrote:
>
>
> Am 21.08.2013 10:24, schrieb Dan Carpenter:
> > The intent was to test if a flag was set. In the current code the
> > conditions are always true.
>
> I guess that it worked before ...
> That leaves the Question: are the tests needed at all ?
It's flagging everything as broken, and I presume that isn't good.
But on the other hand, these changes do occasionally break things
because now a lot of new untested code is used. It really is a good
idea for someone to test this.
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > Static checker stuff. Untested.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [patch] mmc: sdhci-bcm-kona: '|' vs '&' typo
2013-08-21 8:24 [patch] mmc: sdhci-bcm-kona: '|' vs '&' typo Dan Carpenter
2013-08-21 8:57 ` walter harms
@ 2013-08-21 14:30 ` Christian Daudt
1 sibling, 0 replies; 4+ messages in thread
From: Christian Daudt @ 2013-08-21 14:30 UTC (permalink / raw)
To: Dan Carpenter, Chris Ball
Cc: Grant Likely, Rob Herring, Arnd Bergmann,
linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
kernel-janitors@vger.kernel.org
Hi Dan,
Good catch. This fix is already in the "ARM: mmc: fix NONREMOVABLE test in sdhci-bcm-kona" patch that is part of the git pull request sent to armsoc yesterday:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-August/193422.html
Thanks,
Csd
-----Original Message-----
From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
Sent: Wednesday, August 21, 2013 1:24 AM
To: Chris Ball
Cc: Grant Likely; Rob Herring; Christian Daudt; Arnd Bergmann; linux-mmc@vger.kernel.org; devicetree@vger.kernel.org; kernel-janitors@vger.kernel.org
Subject: [patch] mmc: sdhci-bcm-kona: '|' vs '&' typo
The intent was to test if a flag was set. In the current code the
conditions are always true.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static checker stuff. Untested.
diff --git a/drivers/mmc/host/sdhci-bcm-kona.c b/drivers/mmc/host/sdhci-bcm-kona.c
index 87175f9..9ffac0b 100644
--- a/drivers/mmc/host/sdhci-bcm-kona.c
+++ b/drivers/mmc/host/sdhci-bcm-kona.c
@@ -263,7 +263,7 @@ static int __init sdhci_bcm_kona_probe(struct platform_device *pdev)
(mmc_gpio_get_cd(host->mmc) != -ENOSYS) ? 'Y' : 'N',
(mmc_gpio_get_ro(host->mmc) != -ENOSYS) ? 'Y' : 'N');
- if (host->mmc->caps | MMC_CAP_NONREMOVABLE)
+ if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
dev_dbg(dev, "is_8bit=%c\n",
@@ -282,7 +282,7 @@ static int __init sdhci_bcm_kona_probe(struct platform_device *pdev)
}
/* if device is eMMC, emulate card insert right here */
- if (host->mmc->caps | MMC_CAP_NONREMOVABLE) {
+ if (host->mmc->caps & MMC_CAP_NONREMOVABLE) {
ret = sdhci_bcm_kona_sd_card_emulate(host, 1);
if (ret) {
dev_err(dev,
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-08-21 14:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-21 8:24 [patch] mmc: sdhci-bcm-kona: '|' vs '&' typo Dan Carpenter
2013-08-21 8:57 ` walter harms
2013-08-21 9:14 ` Dan Carpenter
2013-08-21 14:30 ` Christian Daudt
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).