With latest glibc (Fedora Rawhide):
../drivers/common/qat/qat_device.c: In function 'qat_dev_cmdline_get_val':
../drivers/common/qat/qat_device.c:183:43: warning: return discards 'const'
        qualifier from pointer target type [-Wdiscarded-qualifiers]
  183 |         return key ? strchr(key, '=') + 1 : NULL;
      |                                           ^
../drivers/common/qat/qat_device.c: In function 'cmdline_validate':
../drivers/common/qat/qat_device.c:189:25: warning: initialization discards
        'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  189 |         char *eq_sign = strchr(arg, '=');
      |                         ^~~~~~

Fixes: 99ab2806687b ("common/qat: isolate parser arguments configuration")
Cc: [email protected]

Signed-off-by: David Marchand <[email protected]>
---
 drivers/common/qat/qat_device.c     | 7 ++++---
 drivers/common/qat/qat_device.h     | 2 +-
 drivers/compress/qat/qat_comp_pmd.c | 2 +-
 drivers/crypto/qat/qat_asym.c       | 2 +-
 drivers/crypto/qat/qat_sym.c        | 2 +-
 5 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c
index b582e3bf8b..07a8b19583 100644
--- a/drivers/common/qat/qat_device.c
+++ b/drivers/common/qat/qat_device.c
@@ -173,7 +173,7 @@ wireless_slice_support(uint16_t pci_dev_id)
  * other than the equals sign is ignored. It will not work with other 
conversion
  * functions like strt*.
  */
-char *qat_dev_cmdline_get_val(struct qat_pci_device *qat_dev,
+const char *qat_dev_cmdline_get_val(struct qat_pci_device *qat_dev,
        const char *key)
 {
        if (qat_dev->command_line == NULL)
@@ -185,8 +185,9 @@ char *qat_dev_cmdline_get_val(struct qat_pci_device 
*qat_dev,
 
 static int cmdline_validate(const char *arg)
 {
+       const char *eq_sign = strchr(arg, '=');
        int i, len;
-       char *eq_sign = strchr(arg, '=');
+
        /* Check for the equal sign */
        if (eq_sign == NULL) {
                QAT_LOG(ERR, "malformed string, no equals sign, %s", arg);
@@ -263,7 +264,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev)
        struct rte_mem_resource *mem_resource;
        const struct rte_memzone *qat_dev_mz;
        int qat_dev_size, extra_size;
-       char *cmdline = NULL;
+       const char *cmdline = NULL;
 
        rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
        snprintf(name+strlen(name), QAT_DEV_NAME_MAX_LEN-strlen(name), "_qat");
diff --git a/drivers/common/qat/qat_device.h b/drivers/common/qat/qat_device.h
index f5ba1592c3..34937e963e 100644
--- a/drivers/common/qat/qat_device.h
+++ b/drivers/common/qat/qat_device.h
@@ -42,7 +42,7 @@ typedef int (*qat_dev_get_extra_size_t)(void);
 typedef int (*qat_dev_get_slice_map_t)(uint32_t *map,
                const struct rte_pci_device *pci_dev);
 
-char *qat_dev_cmdline_get_val(struct qat_pci_device *qat_dev, const char *key);
+const char *qat_dev_cmdline_get_val(struct qat_pci_device *qat_dev, const char 
*key);
 
 struct qat_dev_hw_spec_funcs {
        qat_dev_reset_ring_pairs_t      qat_dev_reset_ring_pairs;
diff --git a/drivers/compress/qat/qat_comp_pmd.c 
b/drivers/compress/qat/qat_comp_pmd.c
index 55e510c91f..92dac79423 100644
--- a/drivers/compress/qat/qat_comp_pmd.c
+++ b/drivers/compress/qat/qat_comp_pmd.c
@@ -690,7 +690,7 @@ qat_comp_dev_create(struct qat_pci_device *qat_pci_dev)
                        &qat_comp_gen_dev_ops[qat_pci_dev->qat_dev_gen];
        uint64_t capa_size;
        uint16_t sub_id = qat_dev_instance->pci_dev->id.subsystem_device_id;
-       char *cmdline = NULL;
+       const char *cmdline = NULL;
 
        snprintf(name, RTE_COMPRESSDEV_NAME_MAX_LEN, "%s_%s",
                        qat_pci_dev->name, "comp");
diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c
index 8808337551..06f037cc14 100644
--- a/drivers/crypto/qat/qat_asym.c
+++ b/drivers/crypto/qat/qat_asym.c
@@ -1697,7 +1697,7 @@ qat_asym_dev_create(struct qat_pci_device *qat_pci_dev)
        char name[RTE_CRYPTODEV_NAME_MAX_LEN];
        char capa_memz_name[RTE_CRYPTODEV_NAME_MAX_LEN];
        uint16_t sub_id = qat_dev_instance->pci_dev->id.subsystem_device_id;
-       char *cmdline = NULL;
+       const char *cmdline = NULL;
 
        snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN, "%s_%s",
                        qat_pci_dev->name, "asym");
diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index d979ae6489..83f1084030 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -217,7 +217,7 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev)
        const struct qat_crypto_gen_dev_ops *gen_dev_ops =
                &qat_sym_gen_dev_ops[qat_pci_dev->qat_dev_gen];
        uint16_t sub_id = qat_dev_instance->pci_dev->id.subsystem_device_id;
-       char *cmdline = NULL;
+       const char *cmdline = NULL;
 
        snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN, "%s_%s",
                        qat_pci_dev->name, "sym");
-- 
2.51.1

Reply via email to