UPSTREAM: usb: dwc3: gadget: Fix truncated cast issue
authorJohn Youn <johnyoun@synopsys.com>
Mon, 23 May 2016 18:32:45 +0000 (11:32 -0700)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 16 Aug 2016 12:48:19 +0000 (20:48 +0800)
commit9557d798b3b41cb52f708eb57cd5246a2cd747a3
treea48899a63226080d7ac2dbd25a97166ece7ffaf2
parent5e8ec28765cd65b078c03d11a5e47e326f738def
UPSTREAM: usb: dwc3: gadget: Fix truncated cast issue

From sparse:
warning: cast truncates bits from constant value (100 becomes 0)

The DWC3_TRB_NUM constant is too big for u8. Do the calculation a
slightly different way that should still be optimized out for the case
where DWC3_TRB_NUM == 256.

Change-Id: If6f9d66a7545230b0d0f21ab05dacd0f572f10b6
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 3de2685f0c395a56b909dbefd40fb287c9df31b2)
drivers/usb/dwc3/gadget.c