Commit aa6292a3 authored by Jani Nikula's avatar Jani Nikula
Browse files

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
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -1627,12 +1627,9 @@ static int edid_block_tag(const void *_block)
	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 false;

	return true;
	return !memchr_inv(edid, 0, length);
}

/**
@@ -1750,7 +1747,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,

bad:
	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");
		} else {
			pr_notice("Raw EDID:\n");
@@ -1878,7 +1875,7 @@ static void connector_bad_edid(struct drm_connector *connector,
		u8 *block = edid + i * EDID_LENGTH;
		char prefix[20];

		if (drm_edid_is_zero(block, EDID_LENGTH))
		if (edid_is_zero(block, EDID_LENGTH))
			sprintf(prefix, "\t[%02x] ZERO ", i);
		else if (!drm_edid_block_valid(block, i, false, NULL))
			sprintf(prefix, "\t[%02x] BAD  ", i);
@@ -1955,7 +1952,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 (i == 0 && drm_edid_is_zero(edid, EDID_LENGTH)) {
		if (i == 0 && edid_is_zero(edid, EDID_LENGTH)) {
			if (null_edid_counter)
				(*null_edid_counter)++;
			goto carp;