DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	David Hunt <david.hunt@intel.com>,
	Sivaprasad Tummala <sivaprasad.tummala@amd.com>
Subject: [PATCH] power: don't disable all cast qualifier warnings
Date: Mon, 12 Aug 2024 14:56:09 -0700	[thread overview]
Message-ID: <20240812215609.97353-1-stephen@networkplumber.org> (raw)

Only in one place does the power library need un-constify a pointer
and this can be done by casting to uintptr_t first. Better, to have
the warning enabled across the rest of the code.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/power/meson.build          | 4 +---
 lib/power/rte_power_pmd_mgmt.c | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/power/meson.build b/lib/power/meson.build
index b8426589b2..2f0f3d26e9 100644
--- a/lib/power/meson.build
+++ b/lib/power/meson.build
@@ -30,7 +30,5 @@ headers = files(
         'rte_power_pmd_mgmt.h',
         'rte_power_uncore.h',
 )
-if cc.has_argument('-Wno-cast-qual')
-    cflags += '-Wno-cast-qual'
-endif
+
 deps += ['timer', 'ethdev']
diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c
index b1c18a5f56..6dec282054 100644
--- a/lib/power/rte_power_pmd_mgmt.c
+++ b/lib/power/rte_power_pmd_mgmt.c
@@ -664,7 +664,7 @@ rte_power_ethdev_pmgmt_queue_disable(unsigned int lcore_id,
 	 * ports before calling any of these API's, so we can assume that the
 	 * callbacks can be freed. we're intentionally casting away const-ness.
 	 */
-	rte_free((void *)queue_cfg->cb);
+	rte_free((void *)(uintptr_t)queue_cfg->cb);
 	free(queue_cfg);
 
 	return 0;
-- 
2.43.0


             reply	other threads:[~2024-08-12 21:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-12 21:56 Stephen Hemminger [this message]
2024-08-13  6:11 ` Morten Brørup
2024-08-13  8:18 ` Bruce Richardson
2024-08-13  8:53 ` lihuisong (C)
2024-09-12  5:19 ` Tyler Retzlaff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240812215609.97353-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=anatoly.burakov@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=sivaprasad.tummala@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).