Skip to content

Commit b290af0

Browse files
tobluxthierryreding
authored andcommitted
drm/tegra: hub: Use fn parameter directly to fix Coccinelle warning
The function parameter out can be used directly instead of assigning it to a temporary u64 variable first. Remove the local variable tmp2 and use the parameter out directly as the divisor in do_div() to remove the following Coccinelle/coccicheck warning reported by do_div.cocci: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead Signed-off-by: Thorsten Blum <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent f790b5c commit b290af0

File tree

1 file changed

+3
-4
lines changed
  • drivers/gpu/drm/tegra

1 file changed

+3
-4
lines changed

drivers/gpu/drm/tegra/hub.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,11 @@ static void tegra_shared_plane_atomic_disable(struct drm_plane *plane,
521521

522522
static inline u32 compute_phase_incr(fixed20_12 in, unsigned int out)
523523
{
524-
u64 tmp, tmp1, tmp2;
524+
u64 tmp, tmp1;
525525

526526
tmp = (u64)dfixed_trunc(in);
527-
tmp2 = (u64)out;
528-
tmp1 = (tmp << NFB) + (tmp2 >> 1);
529-
do_div(tmp1, tmp2);
527+
tmp1 = (tmp << NFB) + ((u64)out >> 1);
528+
do_div(tmp1, out);
530529

531530
return lower_32_bits(tmp1);
532531
}

0 commit comments

Comments
 (0)