It will be useful to accept a struct edid *, but for compatibility with existing usage accept void *.
Unified · Split
| @@ -1580,13 +1580,15 @@ static const u8 edid_header[] = { · 1579 unmodified lines | |||
| 1580 | * | 1580 | * |
| 1581 | * Return: 8 if the header is perfect, down to 0 if it's totally wrong. | 1581 | * Return: 8 if the header is perfect, down to 0 if it's totally wrong. |
| 1582 | */ | 1582 | */ |
| 1583 | int drm_edid_header_is_valid(const u8 *raw_edid) | 1583 | int drm_edid_header_is_valid(const void *_edid) |
| 1584 | { | 1584 | { |
| 1585 | const struct edid *edid = _edid; | ||
| 1585 | int i, score = 0; | 1586 | int i, score = 0; |
| 1586 | 1587 | ||
| 1587 | for (i = 0; i < sizeof(edid_header); i++) | 1588 | for (i = 0; i < sizeof(edid_header); i++) { |
| 1588 | if (raw_edid[i] == edid_header[i]) | 1589 | if (edid->header[i] == edid_header[i]) |
| 1589 | score++; | 1590 | score++; |
| 1591 | } | ||
| 1590 | 1592 | ||
| 1591 | return score; | 1593 | return score; |
| 1592 | } | 1594 | } |
| @@ -578,7 +578,7 @@ int drm_add_modes_noedid(struct drm_connector *connector, · 577 unmodified lines | |||
| 578 | void drm_set_preferred_mode(struct drm_connector *connector, | 578 | void drm_set_preferred_mode(struct drm_connector *connector, |
| 579 | int hpref, int vpref); | 579 | int hpref, int vpref); |
| 580 | 580 | ||
| 581 | int drm_edid_header_is_valid(const u8 *raw_edid); | 581 | int drm_edid_header_is_valid(const void *edid); |
| 582 | bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid, | 582 | bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid, |
| 583 | bool *edid_corrupt); | 583 | bool *edid_corrupt); |
| 584 | bool drm_edid_is_valid(struct edid *edid); | 584 | bool drm_edid_is_valid(struct edid *edid); |