mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
drm/i915: Use mul_u32_u32() more
We have a lot of '(u64)foo * bar' everywhere. Replace with mul_u32_u32() to avoid gcc failing to use a regular 32x32->64 multiply for this. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190408152702.4153-1-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
@@ -71,7 +71,7 @@ static inline u32 mul_round_up_u32_fixed16(u32 val, uint_fixed_16_16_t mul)
|
||||
{
|
||||
u64 tmp;
|
||||
|
||||
tmp = (u64)val * mul.val;
|
||||
tmp = mul_u32_u32(val, mul.val);
|
||||
tmp = DIV_ROUND_UP_ULL(tmp, 1 << 16);
|
||||
WARN_ON(tmp > U32_MAX);
|
||||
|
||||
@@ -83,7 +83,7 @@ static inline uint_fixed_16_16_t mul_fixed16(uint_fixed_16_16_t val,
|
||||
{
|
||||
u64 tmp;
|
||||
|
||||
tmp = (u64)val.val * mul.val;
|
||||
tmp = mul_u32_u32(val.val, mul.val);
|
||||
tmp = tmp >> 16;
|
||||
|
||||
return clamp_u64_to_fixed16(tmp);
|
||||
@@ -114,7 +114,7 @@ static inline uint_fixed_16_16_t mul_u32_fixed16(u32 val, uint_fixed_16_16_t mul
|
||||
{
|
||||
u64 tmp;
|
||||
|
||||
tmp = (u64)val * mul.val;
|
||||
tmp = mul_u32_u32(val, mul.val);
|
||||
|
||||
return clamp_u64_to_fixed16(tmp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user