This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: treewide: fix discards 'const' qualifier from pointer
Author:  Rudi Heitbaum <[email protected]>
Date:    Mon Feb 16 09:08:54 2026 +0000

For ISO C23, the functions strchr, strrchr, and strstr that return
pointers into their input arrays now have definitions as macros that
return a pointer to a const-qualified type when the input argument is
a pointer to a const-qualified type.

Update to const type for variable, as returned string is only used in
comparisons which const can be used.

fixes:
    ../lib/libdvbv5/dvb-dev-local.c:220:19: warning: assignment discards 
'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
      220 |                 p = strstr(pci_dev, "0x");
          |                   ^
    ../lib/libdvbv5/dvb-dev-local.c:224:19: warning: assignment discards 
'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
      224 |                 p = strstr(pci_vend, "0x");
          |                   ^
    ../utils/libmedia_dev/get_media_devices.c: In function 
'get_associated_device':
    ../utils/libmedia_dev/get_media_devices.c:459:19: warning: assignment 
discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
      459 |                 p = strrchr(seek_device, '/');
          |                   ^
    ../utils/ir-ctl/ir-ctl.c: In function 'read_scancode':
    ../utils/ir-ctl/ir-ctl.c:530:19: warning: initialization discards 'const' 
qualifier from pointer target type [-Wdiscarded-qualifiers]
      530 |         char *p = strchr(name, ':');
          |                   ^~~~~~

Signed-off-by: Rudi Heitbaum <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>

 lib/libdvbv5/dvb-dev-local.c           | 3 +--
 utils/ir-ctl/ir-ctl.c                  | 2 +-
 utils/libmedia_dev/get_media_devices.c | 3 ++-
 3 files changed, 4 insertions(+), 4 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=cf55cf6b74d9687c3f3afde7f9fd34fed46593ee
diff --git a/lib/libdvbv5/dvb-dev-local.c b/lib/libdvbv5/dvb-dev-local.c
index ea51147174ec..b89a6c870d45 100644
--- a/lib/libdvbv5/dvb-dev-local.c
+++ b/lib/libdvbv5/dvb-dev-local.c
@@ -208,8 +208,7 @@ static int handle_device_change(struct dvb_device_priv *dvb,
 
        /* Get optional per-bus fields associated with the device parent */
        if (!strcmp(bus_type, "pci")) {
-               const char *pci_dev, *pci_vend;
-               char *p;
+               const char *p, *pci_dev, *pci_vend;
 
                pci_dev = udev_device_get_sysattr_value(parent, 
"subsystem_device");
                pci_vend = udev_device_get_sysattr_value(parent, 
"subsystem_vendor");
diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index 8600fbe61b74..d2ff77e404df 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -527,7 +527,7 @@ static struct send *read_scancode(const char *name)
        struct send *f;
        unsigned scancode;
        char *pstr;
-       char *p = strchr(name, ':');
+       const char *p = strchr(name, ':');
 
        if (!p) {
                fprintf(stderr, _("error: scancode '%s' must be in 
protocol:scancode format\n"), name);
diff --git a/utils/libmedia_dev/get_media_devices.c 
b/utils/libmedia_dev/get_media_devices.c
index 219208672ae4..28efb658e612 100644
--- a/utils/libmedia_dev/get_media_devices.c
+++ b/utils/libmedia_dev/get_media_devices.c
@@ -452,7 +452,8 @@ const char *get_associated_device(void *opaque,
        struct media_devices *md = opaque;
        struct media_device_entry *md_ptr = md->md_entry;
        int i, found = 0;
-       char *prev, *p;
+       const char *p;
+       char *prev;
 
        if (seek_type != NONE && seek_device[0]) {
                /* Get just the device name */
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to