mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-12-11 14:44:08 +00:00
drm/nouveau/kms/nv04-nv4x: Use match_string() helper to simplify the code
match_string() returns the array index of a matching string. Use it instead of the open-coded implementation. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
d7ca5ddf58
commit
2574c809d7
@ -644,16 +644,13 @@ static int nv17_tv_create_resources(struct drm_encoder *encoder,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (nouveau_tv_norm) {
|
if (nouveau_tv_norm) {
|
||||||
for (i = 0; i < num_tv_norms; i++) {
|
i = match_string(nv17_tv_norm_names, num_tv_norms,
|
||||||
if (!strcmp(nv17_tv_norm_names[i], nouveau_tv_norm)) {
|
nouveau_tv_norm);
|
||||||
tv_enc->tv_norm = i;
|
if (i < 0)
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i == num_tv_norms)
|
|
||||||
NV_WARN(drm, "Invalid TV norm setting \"%s\"\n",
|
NV_WARN(drm, "Invalid TV norm setting \"%s\"\n",
|
||||||
nouveau_tv_norm);
|
nouveau_tv_norm);
|
||||||
|
else
|
||||||
|
tv_enc->tv_norm = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_mode_create_tv_properties(dev, num_tv_norms, nv17_tv_norm_names);
|
drm_mode_create_tv_properties(dev, num_tv_norms, nv17_tv_norm_names);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user