PM: EM: Remove an unused variable in em_notify_pd_deleted()
Subsystems (4)
Changwoo Min
reviewerPATCH 1/2 PM: EM: Remove an unused variable in em_notify_pd_deleted()
The variable ret in em_notify_pd_deleted() is set but not used, so that it causes the following warning:
Quoted 1 line
Quoted 1 line
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.
--- kernel/power/em_netlink.c | 2 -- 1 file changed, 2 deletions(-)
kernel/power/em_netlink.c +0 -2
@@ -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; }
Signature · 1 line
2.51.1.dirty
Changwoo Min
reviewerPATCH 2/2 PM: EM: Include the iterator/accessor code for the performance domain conditionally
When CONFIG_ENERGY_MODEL is set but CONFIG_NET is not set, the following errors are raised:
Quoted 1 line
Quoted 1 line
kernel/power/energy_model.c:1003:5: error: redefinition of
'for_each_em_perf_domain'
Quoted 1 line
Quoted 1 line
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.
--- kernel/power/energy_model.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/power/energy_model.c +2 -0
@@ -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
Signature · 1 line
2.51.1.dirty
Rafael J. Wysocki
maintainerQuoted 29 lines · Changwoo Min
The variable
retinem_notify_pd_deleted()is set but not used, so that it causes the following warning:Quoted 1 line
Quoted 1 line
kernel/power/em_netlink.c:228:6: warning: variable 'ret' set butnot used [-Wunused-but-set-variable]
So, let's remove the unused
retto avoid the warning.Reported-by kernel test robot <[email protected]>Signed-off-by Changwoo Min <[email protected]>--- kernel/power/em_netlink.c | 2 -- 1 file changed, 2 deletions(-)kernel/power/em_netlink.c +0
-1@@ -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;
kernel/power/em_netlink.c void em_notify_pd_deleted(const struct em_perf_domain *pd)
Quoted 8 lines
kernel/power/em_netlink.c +0
-2@@ -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?
Changwoo Min
reviewerHi Lukasz,
Quoted 2 lines · Rafael J. Wysocki
Quoted 1 line · Changwoo Min
[..]
Quoted 3 lines
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