drm/edid: convert edid_is_zero() to edid_block_is_zero() for blocks
authorJani Nikula <jani.nikula@intel.com>
Mon, 11 Apr 2022 14:00:24 +0000 (17:00 +0300)
committerJani Nikula <jani.nikula@intel.com>
Thu, 14 Apr 2022 13:51:10 +0000 (16:51 +0300)
As edid_is_zero() is only ever used on EDID blocks, convert it to
edid_block_is_zero() with implicit block size.

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/5cc9387e22b4a61243df4053d1ebcc14b0007dc8.1649685475.git.jani.nikula@intel.com
drivers/gpu/drm/drm_edid.c

index dbca588474c308a0e5c4ec7b85de5cd6637b51a4..a8eedc38a39e79dab8d36a4fe9151e4f098972ea 100644 (file)
@@ -1632,9 +1632,9 @@ static int edid_block_tag(const void *_block)
        return block[0];
 }
 
-static bool edid_is_zero(const void *edid, int length)
+static bool edid_block_is_zero(const void *edid)
 {
-       return !memchr_inv(edid, 0, length);
+       return !memchr_inv(edid, 0, EDID_LENGTH);
 }
 
 /**
@@ -1785,7 +1785,7 @@ bool drm_edid_block_valid(u8 *_block, int block_num, bool print_bad_edid,
        }
 
        if (!valid && print_bad_edid) {
-               if (edid_is_zero(block, EDID_LENGTH)) {
+               if (edid_block_is_zero(block)) {
                        pr_notice("EDID block is all zeroes\n");
                } else {
                        pr_notice("Raw EDID:\n");
@@ -1942,7 +1942,7 @@ static void connector_bad_edid(struct drm_connector *connector,
                u8 *block = edid + i * EDID_LENGTH;
                char prefix[20];
 
-               if (edid_is_zero(block, EDID_LENGTH))
+               if (edid_block_is_zero(block))
                        sprintf(prefix, "\t[%02x] ZERO ", i);
                else if (!drm_edid_block_valid(block, i, false, NULL))
                        sprintf(prefix, "\t[%02x] BAD  ", i);
@@ -2019,7 +2019,7 @@ static struct edid *drm_do_get_edid_base_block(struct drm_connector *connector,
                        goto out;
                if (drm_edid_block_valid(edid, 0, false, edid_corrupt))
                        break;
-               if (try == 0 && edid_is_zero(edid, EDID_LENGTH)) {
+               if (try == 0 && edid_block_is_zero(edid)) {
                        if (null_edid_counter)
                                (*null_edid_counter)++;
                        goto carp;