diff options
author | Felipe Balbi <balbi@ti.com> | 2011-12-21 06:13:33 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-12-21 06:24:43 -0500 |
commit | 14ff96e04c0b29736c8c81fbe75e86dd373c8e22 (patch) | |
tree | c4069fac190ad9eeb3daa20882fd45af149dc41b /drivers/usb/renesas_usbhs/pipe.c | |
parent | abfbe33410d1931d4c18fa73f3c2cea9688aaad6 (diff) |
usb: renesas: pipe: convert a long if into a XOR operation
This is just a minor optimization for the long
if we have on the driver.
When we want to check that one input is true
and the other must be false, the bitwise XOR
operator will achieve that for us.
Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/renesas_usbhs/pipe.c')
-rw-r--r-- | drivers/usb/renesas_usbhs/pipe.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/renesas_usbhs/pipe.c b/drivers/usb/renesas_usbhs/pipe.c index c2559e80d41f..feb06d6d2814 100644 --- a/drivers/usb/renesas_usbhs/pipe.c +++ b/drivers/usb/renesas_usbhs/pipe.c | |||
@@ -330,8 +330,7 @@ static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe, | |||
330 | if (dir_in) | 330 | if (dir_in) |
331 | usbhsp_flags_set(pipe, IS_DIR_HOST); | 331 | usbhsp_flags_set(pipe, IS_DIR_HOST); |
332 | 332 | ||
333 | if ((is_host && !dir_in) || | 333 | if (!!is_host ^ !!dir_in) |
334 | (!is_host && dir_in)) | ||
335 | dir |= DIR_OUT; | 334 | dir |= DIR_OUT; |
336 | 335 | ||
337 | if (!dir) | 336 | if (!dir) |