diff mbox series

[2/2] [cppcheck: use const references

Message ID 20200920024958.8203-2-rosenp@gmail.com (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Rosen Penev Sept. 20, 2020, 2:49 a.m. UTC
Found with constVariable

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 utils/common/media-info.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/utils/common/media-info.cpp b/utils/common/media-info.cpp
index 5e40bafc2..2d7caf3dd 100644
--- a/utils/common/media-info.cpp
+++ b/utils/common/media-info.cpp
@@ -439,7 +439,7 @@  static __u32 read_topology(int media_fd, __u32 major, __u32 minor,
 			*is_invalid = true;
 		return MEDIA_ENT_F_UNKNOWN;
 	}
-	media_v2_interface &iface = v2_ifaces[i];
+	const media_v2_interface &iface = v2_ifaces[i];
 	for (i = 0; i < topology.num_links; i++) {
 		__u32 type = v2_links[i].flags & MEDIA_LNK_FL_LINK_TYPE;
 
@@ -486,7 +486,7 @@  static __u32 read_topology(int media_fd, __u32 major, __u32 minor,
 	if (is_radio)
 		return MEDIA_ENT_F_UNKNOWN;
 
-	media_v2_entity &ent = v2_ents[i];
+	const media_v2_entity &ent = v2_ents[i];
 	printf("Entity Info:\n");
 	printf("\tID               : 0x%08x (%u)\n", ent.id, ent.id);
 	printf("\tName             : %s\n", ent.name);