Commit 14ff96e04c0b29736c8c81fbe75e86dd373c8e22

Authored by Felipe Balbi
1 parent abfbe33410

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>

Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff

drivers/usb/renesas_usbhs/pipe.c
... ... @@ -330,8 +330,7 @@
330 330 if (dir_in)
331 331 usbhsp_flags_set(pipe, IS_DIR_HOST);
332 332  
333   - if ((is_host && !dir_in) ||
334   - (!is_host && dir_in))
  333 + if (!!is_host ^ !!dir_in)
335 334 dir |= DIR_OUT;
336 335  
337 336 if (!dir)