* [PATCH] power: don't disable all cast qualifier warnings
@ 2024-08-12 21:56 Stephen Hemminger
2024-08-13 6:11 ` Morten Brørup
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Stephen Hemminger @ 2024-08-12 21:56 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov, David Hunt, Sivaprasad Tummala
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] power: don't disable all cast qualifier warnings
2024-08-12 21:56 [PATCH] power: don't disable all cast qualifier warnings Stephen Hemminger
@ 2024-08-13 6:11 ` Morten Brørup
2024-10-17 17:50 ` Thomas Monjalon
2024-08-13 8:18 ` Bruce Richardson
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Morten Brørup @ 2024-08-13 6:11 UTC (permalink / raw)
To: Stephen Hemminger, dev; +Cc: Anatoly Burakov, David Hunt, Sivaprasad Tummala
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
>
> 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>
> ---
Agree; disabling warnings should be avoided.
Acked-by: Morten Brørup <mb@smartsharesystems.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power: don't disable all cast qualifier warnings
2024-08-12 21:56 [PATCH] power: don't disable all cast qualifier warnings Stephen Hemminger
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
3 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2024-08-13 8:18 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev, Anatoly Burakov, David Hunt, Sivaprasad Tummala
On Mon, Aug 12, 2024 at 02:56:09PM -0700, Stephen Hemminger wrote:
> 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>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power: don't disable all cast qualifier warnings
2024-08-12 21:56 [PATCH] power: don't disable all cast qualifier warnings Stephen Hemminger
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
3 siblings, 0 replies; 6+ messages in thread
From: lihuisong (C) @ 2024-08-13 8:53 UTC (permalink / raw)
To: Stephen Hemminger, dev; +Cc: Anatoly Burakov, David Hunt, Sivaprasad Tummala
在 2024/8/13 5:56, Stephen Hemminger 写道:
> 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>
> ---
Acked-by: Huisong Li <lihuisong@huawei.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power: don't disable all cast qualifier warnings
2024-08-12 21:56 [PATCH] power: don't disable all cast qualifier warnings Stephen Hemminger
` (2 preceding siblings ...)
2024-08-13 8:53 ` lihuisong (C)
@ 2024-09-12 5:19 ` Tyler Retzlaff
3 siblings, 0 replies; 6+ messages in thread
From: Tyler Retzlaff @ 2024-09-12 5:19 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev, Anatoly Burakov, David Hunt, Sivaprasad Tummala
On Mon, Aug 12, 2024 at 02:56:09PM -0700, Stephen Hemminger wrote:
> 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>
> ---
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power: don't disable all cast qualifier warnings
2024-08-13 6:11 ` Morten Brørup
@ 2024-10-17 17:50 ` Thomas Monjalon
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2024-10-17 17:50 UTC (permalink / raw)
To: Stephen Hemminger
Cc: dev, Anatoly Burakov, David Hunt, Sivaprasad Tummala, Morten Brørup
13/08/2024 08:11, Morten Brørup:
> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> >
> > 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>
> > ---
>
> Agree; disabling warnings should be avoided.
>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Applied, thanks
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-10-17 17:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-12 21:56 [PATCH] power: don't disable all cast qualifier warnings Stephen Hemminger
2024-08-13 6:11 ` Morten Brørup
2024-10-17 17:50 ` Thomas Monjalon
2024-08-13 8:18 ` Bruce Richardson
2024-08-13 8:53 ` lihuisong (C)
2024-09-12 5:19 ` Tyler Retzlaff
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).