]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: f_printer: use non-zero flag for bitwise and
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Fri, 13 Mar 2015 10:08:08 +0000 (11:08 +0100)
committerFelipe Balbi <balbi@ti.com>
Fri, 13 Mar 2015 15:41:05 +0000 (10:41 -0500)
commit7d9334876f2fb56c62895c904f4d2b18f6e62f1b
tree343c7f3ec797185c7a734f0968e65746db18b270
parentb1d509abe775be90be978a4b4bd4b56dd7270e64
usb: gadget: f_printer: use non-zero flag for bitwise and

USB_DIR_OUT happens to be zero, so the result of bitwise and is always 0.
Consequently, break will never happen in the SOFT_RESET case.
This patch uses a compatible condition with a non-zero USB_DIR_IN,
which might or might not evaluate to zero.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/f_printer.c