Commit aa6292a3 authored by Jani Nikula's avatar Jani Nikula

drm/edid: clean up edid_is_zero()

Simplify, rename, take void pointer. No need for the drm_ prefix for
internal helpers.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/15220580f07b63c92a3e448347cf59b297990407.1648752228.git.jani.nikula@intel.com
parent 6d987ddd
...@@ -1627,12 +1627,9 @@ static int edid_block_tag(const void *_block) ...@@ -1627,12 +1627,9 @@ static int edid_block_tag(const void *_block)
return block[0]; return block[0];
} }
static bool drm_edid_is_zero(const u8 *in_edid, int length) static bool edid_is_zero(const void *edid, int length)
{ {
if (memchr_inv(in_edid, 0, length)) return !memchr_inv(edid, 0, length);
return false;
return true;
} }
/** /**
...@@ -1750,7 +1747,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid, ...@@ -1750,7 +1747,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
bad: bad:
if (print_bad_edid) { if (print_bad_edid) {
if (drm_edid_is_zero(raw_edid, EDID_LENGTH)) { if (edid_is_zero(raw_edid, EDID_LENGTH)) {
pr_notice("EDID block is all zeroes\n"); pr_notice("EDID block is all zeroes\n");
} else { } else {
pr_notice("Raw EDID:\n"); pr_notice("Raw EDID:\n");
...@@ -1878,7 +1875,7 @@ static void connector_bad_edid(struct drm_connector *connector, ...@@ -1878,7 +1875,7 @@ static void connector_bad_edid(struct drm_connector *connector,
u8 *block = edid + i * EDID_LENGTH; u8 *block = edid + i * EDID_LENGTH;
char prefix[20]; char prefix[20];
if (drm_edid_is_zero(block, EDID_LENGTH)) if (edid_is_zero(block, EDID_LENGTH))
sprintf(prefix, "\t[%02x] ZERO ", i); sprintf(prefix, "\t[%02x] ZERO ", i);
else if (!drm_edid_block_valid(block, i, false, NULL)) else if (!drm_edid_block_valid(block, i, false, NULL))
sprintf(prefix, "\t[%02x] BAD ", i); sprintf(prefix, "\t[%02x] BAD ", i);
...@@ -1955,7 +1952,7 @@ static struct edid *drm_do_get_edid_base_block(struct drm_connector *connector, ...@@ -1955,7 +1952,7 @@ static struct edid *drm_do_get_edid_base_block(struct drm_connector *connector,
goto out; goto out;
if (drm_edid_block_valid(edid, 0, false, edid_corrupt)) if (drm_edid_block_valid(edid, 0, false, edid_corrupt))
break; break;
if (i == 0 && drm_edid_is_zero(edid, EDID_LENGTH)) { if (i == 0 && edid_is_zero(edid, EDID_LENGTH)) {
if (null_edid_counter) if (null_edid_counter)
(*null_edid_counter)++; (*null_edid_counter)++;
goto carp; goto carp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment