lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 12 Jan 2017 17:24:42 -0800
From:   John Youn <John.Youn@...opsys.com>
To:     Nicholas Mc Guire <hofrat@...dl.org>,
        John Youn <John.Youn@...opsys.com>,
        Felipe Balbi <balbi@...nel.org>
CC:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb: dwc2: host: use true/false for boolean

On 1/12/2017 7:53 AM, Nicholas Mc Guire wrote:
> For boolean variables true/false is preferred over 1/0 for readability.
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@...dl.org>
> ---
> Problem reported by scripts/coccinelle/misc/boolinit.cocci:
> ./drivers/usb/dwc2/hcd.c:5003:2-24: WARNING: Assignment of bool to 0/1
> ./drivers/usb/dwc2/hcd.c:3397:1-21: WARNING: Assignment of bool to 0/1
> ./drivers/usb/dwc2/hcd.c:3335:1-21: WARNING: Assignment of bool to 0/1
> ./drivers/usb/dwc2/hcd.c:2970:3-17: WARNING: Assignment of bool to 0/1
> ./drivers/usb/dwc2/hcd.c:2999:3-16: WARNING: Assignment of bool to 0/1
> ./drivers/usb/dwc2/hcd.c:3299:1-21: WARNING: Assignment of bool to 0/1
> 
> Patch was compile tested with: x86_64_defconfig + CONFIG_USB_DWC2
> 
> Patch is against 4.10-rc3 (localversion-next is next-20170112)
> 
>  drivers/usb/dwc2/hcd.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
> index 9f66777..7467a37 100644
> --- a/drivers/usb/dwc2/hcd.c
> +++ b/drivers/usb/dwc2/hcd.c
> @@ -2967,7 +2967,7 @@ static void dwc2_process_periodic_channels(struct dwc2_hsotg *hsotg)
>  		qspcavail = (tx_status & TXSTS_QSPCAVAIL_MASK) >>
>  			    TXSTS_QSPCAVAIL_SHIFT;
>  		if (qspcavail == 0) {
> -			no_queue_space = 1;
> +			no_queue_space = true;
>  			break;
>  		}
>  
> @@ -2996,7 +2996,7 @@ static void dwc2_process_periodic_channels(struct dwc2_hsotg *hsotg)
>  			    TXSTS_FSPCAVAIL_SHIFT;
>  		status = dwc2_queue_transaction(hsotg, qh->channel, fspcavail);
>  		if (status < 0) {
> -			no_fifo_space = 1;
> +			no_fifo_space = true;
>  			break;
>  		}
>  
> @@ -3296,7 +3296,7 @@ static void dwc2_wakeup_detected(unsigned long data)
>  		dwc2_readl(hsotg->regs + HPRT0));
>  
>  	dwc2_hcd_rem_wakeup(hsotg);
> -	hsotg->bus_suspended = 0;
> +	hsotg->bus_suspended = false;
>  
>  	/* Change to L0 state */
>  	hsotg->lx_state = DWC2_L0;
> @@ -3332,7 +3332,7 @@ static void dwc2_port_suspend(struct dwc2_hsotg *hsotg, u16 windex)
>  	hprt0 |= HPRT0_SUSP;
>  	dwc2_writel(hprt0, hsotg->regs + HPRT0);
>  
> -	hsotg->bus_suspended = 1;
> +	hsotg->bus_suspended = true;
>  
>  	/*
>  	 * If hibernation is supported, Phy clock will be suspended
> @@ -3394,7 +3394,7 @@ static void dwc2_port_resume(struct dwc2_hsotg *hsotg)
>  	hprt0 = dwc2_read_hprt0(hsotg);
>  	hprt0 &= ~(HPRT0_RES | HPRT0_SUSP);
>  	dwc2_writel(hprt0, hsotg->regs + HPRT0);
> -	hsotg->bus_suspended = 0;
> +	hsotg->bus_suspended = false;
>  	spin_unlock_irqrestore(&hsotg->lock, flags);
>  }
>  
> @@ -5000,7 +5000,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq)
>  	    hsotg->dev->dma_mask == NULL) {
>  		dev_warn(hsotg->dev,
>  			 "dma_mask not set, disabling DMA\n");
> -		hsotg->params.host_dma = 0;
> +		hsotg->params.host_dma = false;
>  		hsotg->params.dma_desc_enable = 0;
>  	}
>  
> 

+Felipe

Acked-by: John Youn <johnyoun@...opsys.com>

This one also required fix-up for next.

Regards,
John

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ