| with a non-zero constant is always true.
Likely these should have been &.
Joe Perches (4):
mac80211: Fix likely misuse of | for &
can: cc770: Fix likely misuse of | for &
brcmfmac: Fix likely misuse of | for &
usb: gadget: pch_udc: Fix likely misuse of | for &
drivers/net/can/cc770/cc770_platform.c | 2 +-
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 4 ++--
drivers/usb/gadget/pch_udc.c | 2 +-
net/mac80211/cfg.c | 6 +++---
4 files changed, 7 insertions(+), 7 deletions(-)
--
1.7.8.111.gad25c.dirty
Using | with a constant is always true.
Likely this should have be &.
cc: Ben Greear <[email protected]>
Signed-off-by: Joe Perches <[email protected]>
---
net/mac80211/cfg.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 495831e..e9cecca 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -533,16 +533,16 @@ static void ieee80211_get_et_stats(struct wiphy *wiphy,
sinfo.filled = 0;
sta_set_sinfo(sta, &sinfo);
- if (sinfo.filled | STATION_INFO_TX_BITRATE)
+ if (sinfo.filled & STATION_INFO_TX_BITRATE)
data[i] = 100000 *
cfg80211_calculate_bitrate(&sinfo.txrate);
i++;
- if (sinfo.filled | STATION_INFO_RX_BITRATE)
+ if (sinfo.filled & STATION_INFO_RX_BITRATE)
data[i] = 100000 *
cfg80211_calculate_bitrate(&sinfo.rxrate);
i++;
- if (sinfo.filled | STATION_INFO_SIGNAL_AVG)
+ if (sinfo.filled & STATION_INFO_SIGNAL_AVG)
data[i] = (u8)sinfo.signal_avg;
i++;
} else {
--
1.7.8.111.gad25c.dirty
Using | with a constant is always true.
Likely this should have be &.
Signed-off-by: Joe Perches <[email protected]>
---
drivers/net/can/cc770/cc770_platform.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/can/cc770/cc770_platform.c b/drivers/net/can/cc770/cc770_platform.c
index 53115ee..688371c 100644
--- a/drivers/net/can/cc770/cc770_platform.c
+++ b/drivers/net/can/cc770/cc770_platform.c
@@ -154,7 +154,7 @@ static int __devinit cc770_get_platform_data(struct platform_device *pdev,
struct cc770_platform_data *pdata = pdev->dev.platform_data;
priv->can.clock.freq = pdata->osc_freq;
- if (priv->cpu_interface | CPUIF_DSC)
+ if (priv->cpu_interface & CPUIF_DSC)
priv->can.clock.freq /= 2;
priv->clkout = pdata->cor;
priv->bus_config = pdata->bcr;
--
1.7.8.111.gad25c.dirty
Using | with a constant is always true.
Likely this should have be &.
Signed-off-by: Joe Perches <[email protected]>
---
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
index e2480d1..8e7e692 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
@@ -89,9 +89,9 @@ int brcmf_sdio_intr_register(struct brcmf_sdio_dev *sdiodev)
data |= 1 << SDIO_FUNC_1 | 1 << SDIO_FUNC_2 | 1;
brcmf_sdio_regwb(sdiodev, SDIO_CCCR_IENx, data, &ret);
- /* redirect, configure ane enable io for interrupt signal */
+ /* redirect, configure and enable io for interrupt signal */
data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE;
- if (sdiodev->irq_flags | IRQF_TRIGGER_HIGH)
+ if (sdiodev->irq_flags & IRQF_TRIGGER_HIGH)
data |= SDIO_SEPINT_ACT_HI;
brcmf_sdio_regwb(sdiodev, SDIO_CCCR_BRCM_SEPINT, data, &ret);
--
1.7.8.111.gad25c.dirty
Using | with a constant is always true.
Likely this should have be &.
Signed-off-by: Joe Perches <[email protected]>
---
drivers/usb/gadget/pch_udc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
index 1cfcc9e..f4fb71c 100644
--- a/drivers/usb/gadget/pch_udc.c
+++ b/drivers/usb/gadget/pch_udc.c
@@ -2208,7 +2208,7 @@ static void pch_udc_complete_receiver(struct pch_udc_ep *ep)
return;
}
if ((td->status & PCH_UDC_BUFF_STS) == PCH_UDC_BS_DMA_DONE)
- if (td->status | PCH_UDC_DMA_LAST) {
+ if (td->status & PCH_UDC_DMA_LAST) {
count = td->status & PCH_UDC_RXTX_BYTES;
break;
}
--
1.7.8.111.gad25c.dirty
On 05/30/2012 01:25 PM, Joe Perches wrote:
> Using | with a constant is always true.
> Likely this should have be&.
Yes, I think your change is correct. Looks like something
a compiler or static analysis tool could catch and warn about...
Sorry for the bug!
Ben
>
> cc: Ben Greear<[email protected]>
> Signed-off-by: Joe Perches<[email protected]>
> ---
> net/mac80211/cfg.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index 495831e..e9cecca 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -533,16 +533,16 @@ static void ieee80211_get_et_stats(struct wiphy *wiphy,
> sinfo.filled = 0;
> sta_set_sinfo(sta,&sinfo);
>
> - if (sinfo.filled | STATION_INFO_TX_BITRATE)
> + if (sinfo.filled& STATION_INFO_TX_BITRATE)
> data[i] = 100000 *
> cfg80211_calculate_bitrate(&sinfo.txrate);
> i++;
> - if (sinfo.filled | STATION_INFO_RX_BITRATE)
> + if (sinfo.filled& STATION_INFO_RX_BITRATE)
> data[i] = 100000 *
> cfg80211_calculate_bitrate(&sinfo.rxrate);
> i++;
>
> - if (sinfo.filled | STATION_INFO_SIGNAL_AVG)
> + if (sinfo.filled& STATION_INFO_SIGNAL_AVG)
> data[i] = (u8)sinfo.signal_avg;
> i++;
> } else {
--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com
On 05/30/2012 10:25 PM, Joe Perches wrote:
> Using | with a constant is always true.
> Likely this should have be &.
Acked-by: Arend van Spriel <[email protected]>
> Signed-off-by: Joe Perches <[email protected]>
> ---
> drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
On Wed, May 30, 2012 at 01:25:57PM -0700, Joe Perches wrote:
> Using | with a constant is always true.
> Likely this should have be &.
>
> Signed-off-by: Joe Perches <[email protected]>
this looks good to me. Do you want me to carry it on my tree ?
If you want to carry it out as a fix:
Acked-by: Felipe Balbi <[email protected]>
> ---
> drivers/usb/gadget/pch_udc.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
> index 1cfcc9e..f4fb71c 100644
> --- a/drivers/usb/gadget/pch_udc.c
> +++ b/drivers/usb/gadget/pch_udc.c
> @@ -2208,7 +2208,7 @@ static void pch_udc_complete_receiver(struct pch_udc_ep *ep)
> return;
> }
> if ((td->status & PCH_UDC_BUFF_STS) == PCH_UDC_BS_DMA_DONE)
> - if (td->status | PCH_UDC_DMA_LAST) {
> + if (td->status & PCH_UDC_DMA_LAST) {
> count = td->status & PCH_UDC_RXTX_BYTES;
> break;
> }
> --
> 1.7.8.111.gad25c.dirty
>
--
balbi
On Thu, 2012-05-31 at 10:25 +0300, Felipe Balbi wrote:
> On Wed, May 30, 2012 at 01:25:57PM -0700, Joe Perches wrote:
> > Using | with a constant is always true.
> > Likely this should have be &.
> > Signed-off-by: Joe Perches <[email protected]>
> this looks good to me. Do you want me to carry it on my tree ?
> If you want to carry it out as a fix:
> Acked-by: Felipe Balbi <[email protected]>
I presume that question is for Greg.
On 05/30/2012 10:25 PM, Joe Perches wrote:
> Using | with a constant is always true.
> Likely this should have be &.
>
> Signed-off-by: Joe Perches <[email protected]>
Sounds reasonable. And there are no in tree users of the platform driver
that this fix could break.
commited to linux-can,
Marc
> ---
> drivers/net/can/cc770/cc770_platform.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/can/cc770/cc770_platform.c b/drivers/net/can/cc770/cc770_platform.c
> index 53115ee..688371c 100644
> --- a/drivers/net/can/cc770/cc770_platform.c
> +++ b/drivers/net/can/cc770/cc770_platform.c
> @@ -154,7 +154,7 @@ static int __devinit cc770_get_platform_data(struct platform_device *pdev,
> struct cc770_platform_data *pdata = pdev->dev.platform_data;
>
> priv->can.clock.freq = pdata->osc_freq;
> - if (priv->cpu_interface | CPUIF_DSC)
> + if (priv->cpu_interface & CPUIF_DSC)
> priv->can.clock.freq /= 2;
> priv->clkout = pdata->cor;
> priv->bus_config = pdata->bcr;
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
On Thu, May 31, 2012 at 12:44:43PM -0700, Joe Perches wrote:
> On Thu, 2012-05-31 at 10:25 +0300, Felipe Balbi wrote:
> > On Wed, May 30, 2012 at 01:25:57PM -0700, Joe Perches wrote:
> > > Using | with a constant is always true.
> > > Likely this should have be &.
> > > Signed-off-by: Joe Perches <[email protected]>
> > this looks good to me. Do you want me to carry it on my tree ?
> > If you want to carry it out as a fix:
> > Acked-by: Felipe Balbi <[email protected]>
>
> I presume that question is for Greg.
Then I'll take it... driver/usb/gadget/ goes through me.
--
balbi