mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] PM: EM: Remove an unused variable in em_notify_pd_deleted()
@ 2025-10-20  8:44 Changwoo Min
  2025-10-20  8:44 ` [PATCH 2/2] PM: EM: Include the iterator/accessor code for the performance domain conditionally Changwoo Min
  2025-10-20 12:17 ` [PATCH 1/2] PM: EM: Remove an unused variable in em_notify_pd_deleted() Rafael J. Wysocki
  0 siblings, 2 replies; 4+ messages in thread
From: Changwoo Min @ 2025-10-20  8:44 UTC (permalink / raw)
  To: lukasz.luba, rafael, len.brown, pavel
  Cc: christian.loehle, tj, kernel-dev, linux-pm, sched-ext,
	linux-kernel, Changwoo Min, kernel test robot

The variable `ret` in em_notify_pd_deleted() is set but not used, so
that it causes the following warning:

>> kernel/power/em_netlink.c:228:6: warning: variable 'ret' set but
   not used [-Wunused-but-set-variable]

So, let's remove the unused `ret` to avoid the warning.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202510151223.THlBK6QR-lkp@intel.com/
Signed-off-by: Changwoo Min <changwoo@igalia.com>
---
 kernel/power/em_netlink.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/power/em_netlink.c b/kernel/power/em_netlink.c
index 2c55c758de6b..48752189a07b 100644
--- a/kernel/power/em_netlink.c
+++ b/kernel/power/em_netlink.c
@@ -269,7 +269,6 @@ static int __em_notify_pd_deleted_size(const struct em_perf_domain *pd)
 void em_notify_pd_deleted(const struct em_perf_domain *pd)
 {
 	struct sk_buff *msg;
-	int ret = -EMSGSIZE;
 	void *hdr;
 	int msg_sz;
 
@@ -287,7 +286,6 @@ void em_notify_pd_deleted(const struct em_perf_domain *pd)
 		goto out_free_msg;
 
 	if (nla_put_u32(msg, EM_A_PD_TABLE_PD_ID, pd->id)) {
-		ret = -EMSGSIZE;
 		goto out_free_msg;
 	}
 
-- 
2.51.1.dirty


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] PM: EM: Include the iterator/accessor code for the performance domain conditionally
  2025-10-20  8:44 [PATCH 1/2] PM: EM: Remove an unused variable in em_notify_pd_deleted() Changwoo Min
@ 2025-10-20  8:44 ` Changwoo Min
  2025-10-20 12:17 ` [PATCH 1/2] PM: EM: Remove an unused variable in em_notify_pd_deleted() Rafael J. Wysocki
  1 sibling, 0 replies; 4+ messages in thread
From: Changwoo Min @ 2025-10-20  8:44 UTC (permalink / raw)
  To: lukasz.luba, rafael, len.brown, pavel
  Cc: christian.loehle, tj, kernel-dev, linux-pm, sched-ext,
	linux-kernel, Changwoo Min, kernel test robot

When CONFIG_ENERGY_MODEL is set but CONFIG_NET is not set, the following
errors are raised:

>> kernel/power/energy_model.c:1003:5: error: redefinition of
   'for_each_em_perf_domain'

>> kernel/power/energy_model.c:1022:24: error: redefinition of
   'em_perf_domain_get_by_id'

That is because these two functions are defined in em_netlink.h (empty
function body) and energy_model.c (actual implementation).

To avoid the compilation errors, conditionally include the actual function
implementations in energy_model.c when both CONFIG_ENERGY_MODEL and
CONFIG_NET are set.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202510151232.UNZ2J7TZ-lkp@intel.com/
Signed-off-by: Changwoo Min <changwoo@igalia.com>
---
 kernel/power/energy_model.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
index 92c12b5983ed..e669d5057fca 100644
--- a/kernel/power/energy_model.c
+++ b/kernel/power/energy_model.c
@@ -1006,6 +1006,7 @@ void em_rebuild_sched_domains(void)
 	schedule_work(&rebuild_sd_work);
 }
 
+#if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_NET)
 int for_each_em_perf_domain(int (*cb)(struct em_perf_domain*, void *),
 			    void *data)
 {
@@ -1039,3 +1040,4 @@ struct em_perf_domain *em_perf_domain_get_by_id(int id)
 
 	return NULL;
 }
+#endif
-- 
2.51.1.dirty


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] PM: EM: Remove an unused variable in em_notify_pd_deleted()
  2025-10-20  8:44 [PATCH 1/2] PM: EM: Remove an unused variable in em_notify_pd_deleted() Changwoo Min
  2025-10-20  8:44 ` [PATCH 2/2] PM: EM: Include the iterator/accessor code for the performance domain conditionally Changwoo Min
@ 2025-10-20 12:17 ` Rafael J. Wysocki
  2025-10-20 21:27   ` Changwoo Min
  1 sibling, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2025-10-20 12:17 UTC (permalink / raw)
  To: Changwoo Min
  Cc: lukasz.luba, rafael, len.brown, pavel, christian.loehle, tj,
	kernel-dev, linux-pm, sched-ext, linux-kernel, kernel test robot

On Mon, Oct 20, 2025 at 10:45 AM Changwoo Min <changwoo@igalia.com> wrote:
>
> The variable `ret` in em_notify_pd_deleted() is set but not used, so
> that it causes the following warning:
>
> >> kernel/power/em_netlink.c:228:6: warning: variable 'ret' set but
>    not used [-Wunused-but-set-variable]
>
> So, let's remove the unused `ret` to avoid the warning.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202510151223.THlBK6QR-lkp@intel.com/
> Signed-off-by: Changwoo Min <changwoo@igalia.com>
> ---
>  kernel/power/em_netlink.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/kernel/power/em_netlink.c b/kernel/power/em_netlink.c
> index 2c55c758de6b..48752189a07b 100644
> --- a/kernel/power/em_netlink.c
> +++ b/kernel/power/em_netlink.c
> @@ -269,7 +269,6 @@ static int __em_notify_pd_deleted_size(const struct em_perf_domain *pd)
>  void em_notify_pd_deleted(const struct em_perf_domain *pd)
>  {
>         struct sk_buff *msg;
> -       int ret = -EMSGSIZE;
>         void *hdr;
>         int msg_sz;
>
> @@ -287,7 +286,6 @@ void em_notify_pd_deleted(const struct em_perf_domain *pd)
>                 goto out_free_msg;
>
>         if (nla_put_u32(msg, EM_A_PD_TABLE_PD_ID, pd->id)) {
> -               ret = -EMSGSIZE;
>                 goto out_free_msg;
>         }
>
> --

Would you please fix the patches on top of which these fixes are needed?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] PM: EM: Remove an unused variable in em_notify_pd_deleted()
  2025-10-20 12:17 ` [PATCH 1/2] PM: EM: Remove an unused variable in em_notify_pd_deleted() Rafael J. Wysocki
@ 2025-10-20 21:27   ` Changwoo Min
  0 siblings, 0 replies; 4+ messages in thread
From: Changwoo Min @ 2025-10-20 21:27 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: lukasz.luba, len.brown, pavel, christian.loehle, tj, kernel-dev,
	linux-pm, sched-ext, linux-kernel, kernel test robot

Hi Lukasz,

On 10/20/25 21:17, Rafael J. Wysocki wrote:
> On Mon, Oct 20, 2025 at 10:45 AM Changwoo Min <changwoo@igalia.com> wrote:
>>

[..]

> 
> Would you please fix the patches on top of which these fixes are needed?
> 

Sure, I will send the whole patchset (v6) with the two fixes in.

Regards,
Changwoo Min



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-20 21:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-20  8:44 [PATCH 1/2] PM: EM: Remove an unused variable in em_notify_pd_deleted() Changwoo Min
2025-10-20  8:44 ` [PATCH 2/2] PM: EM: Include the iterator/accessor code for the performance domain conditionally Changwoo Min
2025-10-20 12:17 ` [PATCH 1/2] PM: EM: Remove an unused variable in em_notify_pd_deleted() Rafael J. Wysocki
2025-10-20 21:27   ` Changwoo Min

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®