Commit 14ff96e0 authored by Felipe Balbi's avatar Felipe Balbi

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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent abfbe334
......@@ -330,8 +330,7 @@ static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe,
if (dir_in)
usbhsp_flags_set(pipe, IS_DIR_HOST);
if ((is_host && !dir_in) ||
(!is_host && dir_in))
if (!!is_host ^ !!dir_in)
dir |= DIR_OUT;
if (!dir)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment