diff mbox series

cpupower: Change the var type of the 'monitor' subcommand display mode

Message ID 20240619-change-mode-type-v1-1-31e7e45028f0@gmail.com
State New
Headers show
Series cpupower: Change the var type of the 'monitor' subcommand display mode | expand

Commit Message

Roman Storozhenko June 19, 2024, 7:54 a.m. UTC
There is a type 'enum operation_mode_e' contains the display modes of
the 'monitor' subcommand. This type isn't used though, instead the
variable 'mode' is of a simple 'int' type.
Change 'mode' variable type from 'int' to 'enum operation_mode_e' in
order to improve compiler type checking.

Signed-off-by: Roman Storozhenko <romeusmeister@gmail.com>
---
Built and tested this with different monitor cmdline params. Everything
works as expected, that is nothing changed and no regressions
encountered.
---
 tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


---
base-commit: 0c52056d9f77508cb6d4d68d3fc91c6c08ec71af
change-id: 20240619-change-mode-type-e8de8430ccca

Best regards,

Comments

Shuah Khan June 20, 2024, 3:36 p.m. UTC | #1
On 6/19/24 01:54, Roman Storozhenko wrote:
> There is a type 'enum operation_mode_e' contains the display modes of
> the 'monitor' subcommand. This type isn't used though, instead the
> variable 'mode' is of a simple 'int' type.
> Change 'mode' variable type from 'int' to 'enum operation_mode_e' in
> order to improve compiler type checking.
> 
> Signed-off-by: Roman Storozhenko <romeusmeister@gmail.com>
> ---
> Built and tested this with different monitor cmdline params. Everything
> works as expected, that is nothing changed and no regressions
> encountered.

This above belongs in the change log. There is no need to add
throw away things for patches in general unless there is a reason
to such as v1 to v2 changes.

> ---
>   tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
> index 075e766ff1f3..f746099b5dac 100644
> --- a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
> +++ b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
> @@ -35,7 +35,7 @@ static unsigned int avail_monitors;
>   static char *progname;
>   
>   enum operation_mode_e { list = 1, show, show_all };
> -static int mode;
> +static enum operation_mode_e mode;
>   static int interval = 1;
>   static char *show_monitors_param;
>   static struct cpupower_topology cpu_top;
> 
> ---
> base-commit: 0c52056d9f77508cb6d4d68d3fc91c6c08ec71af
> change-id: 20240619-change-mode-type-e8de8430ccca
> 
> Best regards,

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
index 075e766ff1f3..f746099b5dac 100644
--- a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
+++ b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
@@ -35,7 +35,7 @@  static unsigned int avail_monitors;
 static char *progname;
 
 enum operation_mode_e { list = 1, show, show_all };
-static int mode;
+static enum operation_mode_e mode;
 static int interval = 1;
 static char *show_monitors_param;
 static struct cpupower_topology cpu_top;