]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/edid: reduce magic when updating the EDID block checksum
authorJani Nikula <jani.nikula@intel.com>
Thu, 31 Mar 2022 18:45:09 +0000 (21:45 +0300)
committerJani Nikula <jani.nikula@intel.com>
Fri, 1 Apr 2022 14:44:46 +0000 (17:44 +0300)
The code modifying the EDID block should not need to do tricks to fix
the checksum. We have a function for computing the checksum, use it.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/5a11435419d804a58ef356c0b9acf445cffc1354.1648752228.git.jani.nikula@intel.com
drivers/gpu/drm/drm_edid.c

index 620e97a3a1e79c2d283e012eceebbe5001e88d5c..190b1d780375fbbec2d7fb7a75ffc21e1e10ca97 100644 (file)
@@ -1842,8 +1842,8 @@ static struct edid *edid_filter_invalid_blocks(const struct edid *edid,
                        memcpy(dest_block++, block, EDID_LENGTH);
        }
 
-       new->checksum += new->extensions - valid_extensions;
        new->extensions = valid_extensions;
+       new->checksum = edid_block_compute_checksum(new);
 
 out:
        kfree(edid);