drm/amd/display: Don't check for NULL divisor in fixpt code
authorHarry Wentland <harry.wentland@amd.com>
Mon, 28 Apr 2025 20:26:20 +0000 (16:26 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 7 May 2025 21:40:15 +0000 (17:40 -0400)
[Why]
We check for a NULL divisor but don't act on it.
This check does nothing other than throw a warning.
It does confuse static checkers though:
See https://lkml.org/lkml/2025/4/26/371

[How]
Drop the ASSERTs in both DC and SPL variants.

Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)")
Fixes: 6efc0ab3b05d ("drm/amd/display: add back quality EASF and ISHARP and dc dependency changes")
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Leo Li <sunpeng.li@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c
drivers/gpu/drm/amd/display/dc/sspl/spl_fixpt31_32.c

index 88d3f9d7dd556ae3cecc3631cce1ba24980a01b6..452206b5095eb0f77fecc890bdfe0ef1ea8b5fcd 100644 (file)
@@ -51,8 +51,6 @@ static inline unsigned long long complete_integer_division_u64(
 {
        unsigned long long result;
 
-       ASSERT(divisor);
-
        result = div64_u64_rem(dividend, divisor, remainder);
 
        return result;
@@ -213,9 +211,6 @@ struct fixed31_32 dc_fixpt_recip(struct fixed31_32 arg)
         * @note
         * Good idea to use Newton's method
         */
-
-       ASSERT(arg.value);
-
        return dc_fixpt_from_fraction(
                dc_fixpt_one.value,
                arg.value);
index 52d97918a3bd2140c8fe0200a04bc9e28bceb861..ebf0287417e0eb85165ab917cf91bdbfb2625ad7 100644 (file)
@@ -29,8 +29,6 @@ static inline unsigned long long spl_complete_integer_division_u64(
 {
        unsigned long long result;
 
-       SPL_ASSERT(divisor);
-
        result = spl_div64_u64_rem(dividend, divisor, remainder);
 
        return result;
@@ -196,8 +194,6 @@ struct spl_fixed31_32 spl_fixpt_recip(struct spl_fixed31_32 arg)
         * Good idea to use Newton's method
         */
 
-       SPL_ASSERT(arg.value);
-
        return spl_fixpt_from_fraction(
                spl_fixpt_one.value,
                arg.value);