[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FD0A5F9.9050405@mvista.com>
Date:	Thu, 07 Jun 2012 17:00:41 +0400
From:	Sergei Shtylyov <sshtylyov@...sta.com>
To:	Julia Lawall <Julia.Lawall@...6.fr>
CC:	Felipe Balbi <balbi@...com>, kernel-janitors@...r.kernel.org,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	joe@...ches.com, Julia Lawall <julia@...u.dk>
Subject: Re: [PATCH 3/7] drivers/usb/gadget/pch_udc.c: adjust suspicious bit
 operation
Hello.
On 07-06-2012 1:41, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@...6.fr>
> PCH_UDC_DMA_LAST is 0x08000000 so a bit-or with this value always gives a
> nonzero result.  The test is rewritten as done elsewhere in the same file.
> This problem was found using Coccinelle (http://coccinelle.lip6.fr/).
> Signed-off-by: Julia Lawall<julia@...u.dk>
> ---
>   drivers/usb/gadget/pch_udc.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
> index 1cfcc9e..79f7a53 100644
> --- a/drivers/usb/gadget/pch_udc.c
> +++ b/drivers/usb/gadget/pch_udc.c
> @@ -2208,7 +2208,8 @@ 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_data->status&  PCH_UDC_DMA_LAST)
> +			    == PCH_UDC_DMA_LAST) {
    But why not simply:
			if (td_data->status & PCH_UDC_DMA_LAST)
if the constant is single bit anyway? And are you sure about s/td/td_data/?
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
