Skip to contentSkip to conversation

tests/kms_setmode: Fix compilation warnings.

PATCH In review Marius Vlad 2 participants 2 messages Mar 7, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/kms_setmode: Fix compilation warnings.

kms_setmode.c:384:30: warning: declaration of ‘drm_fd’ shadows a global declaration [-Wshadow]

kms_setmode.c:45:12: note: shadowed declaration is here static int drm_fd;

kms_setmode.c:391:38: warning: passing argument 8 of ‘drmModeSetCrtc’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] ids, crtc->connector_count, &crtc->mode);

---
 tests/kms_setmode.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tests/kms_setmode.c +4 -4
index 6afe00c..e7a5bee 100644
@@ -381,23 +381,23 @@ static uint32_t *get_connector_ids(struct crtc_config *crtc)
 	return ids;
 }
 
-static int test_stealing(int drm_fd, const struct crtc_config *crtc, uint32_t *ids)
+static int test_stealing(int fd, struct crtc_config *crtc, uint32_t *ids)
 {
 	int i, ret = 0;
 
 	if (!crtc->connector_count)
-		return drmModeSetCrtc(drm_fd, crtc->crtc_id,
+		return drmModeSetCrtc(fd, crtc->crtc_id,
 				     crtc->fb_info.fb_id, 0, 0,
 				     ids, crtc->connector_count, &crtc->mode);
 
 	for (i = 0; i < crtc->connector_count; ++i) {
-		ret = drmModeSetCrtc(drm_fd, crtc->crtc_id,
+		ret = drmModeSetCrtc(fd, crtc->crtc_id,
 				     crtc->fb_info.fb_id, 0, 0,
 				     &ids[i], 1, &crtc->mode);
 
 		igt_assert_eq(ret, 0);
 
-		ret = drmModeSetCrtc(drm_fd, crtc->crtc_id,
+		ret = drmModeSetCrtc(fd, crtc->crtc_id,
 				     crtc->fb_info.fb_id, 0, 0,
 				     ids, crtc->connector_count, &crtc->mode);
 
Signature · 6 lines
2.7.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

Op 07-03-16 om 11:59 schreef Marius Vlad:

Quoted 11 lines

kms_setmode.c:384:30: warning: declaration of ‘drm_fd’ shadows a global declaration [-Wshadow]

kms_setmode.c:45:12: note: shadowed declaration is here static int drm_fd;

kms_setmode.c:391:38: warning: passing argument 8 of ‘drmModeSetCrtc’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] ids, crtc->connector_count, &crtc->mode);

Pushed, thanks.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx