Patchwork [01/11] lib: fwts_ac_adapter: constify state

login
register
mail settings
Submitter Colin King
Date Oct. 16, 2012, 7:20 p.m.
Message ID <1350415248-16965-2-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/191855/
State Accepted
Headers show

Comments

Colin King - Oct. 16, 2012, 7:20 p.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/include/fwts_ac_adapter.h |    2 +-
 src/lib/src/fwts_ac_adapter.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Keng-Yu Lin - Oct. 18, 2012, 6:47 a.m.
On Wed, Oct 17, 2012 at 3:20 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/include/fwts_ac_adapter.h |    2 +-
>  src/lib/src/fwts_ac_adapter.c     |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/lib/include/fwts_ac_adapter.h b/src/lib/include/fwts_ac_adapter.h
> index 905984f..9f387db 100644
> --- a/src/lib/include/fwts_ac_adapter.h
> +++ b/src/lib/include/fwts_ac_adapter.h
> @@ -27,6 +27,6 @@
>  #define FWTS_AC_ADAPTER_ONLINE (0x1)
>  #define FWTS_AC_ADAPTER_OFFLINE        (0x2)
>
> -int fwts_ac_adapter_get_state(int state, int *matching, int *not_matching);
> +int fwts_ac_adapter_get_state(const int state, int *matching, int *not_matching);
>
>  #endif
> diff --git a/src/lib/src/fwts_ac_adapter.c b/src/lib/src/fwts_ac_adapter.c
> index be07be8..9db1748 100644
> --- a/src/lib/src/fwts_ac_adapter.c
> +++ b/src/lib/src/fwts_ac_adapter.c
> @@ -70,7 +70,7 @@ static fwts_ac_interface_info fwts_ac_interfaces[] = {
>   *     not_matching is incremented for each AC adapter instance that does
>   *     not match.
>   */
> -int fwts_ac_adapter_get_state(int state, int *matching, int *not_matching)
> +int fwts_ac_adapter_get_state(const int state, int *matching, int *not_matching)
>  {
>         DIR *ac_power_dir;
>         struct dirent *entry;
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - Oct. 22, 2012, 9:30 a.m.
On 10/17/2012 03:20 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/include/fwts_ac_adapter.h |    2 +-
>   src/lib/src/fwts_ac_adapter.c     |    2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/lib/include/fwts_ac_adapter.h b/src/lib/include/fwts_ac_adapter.h
> index 905984f..9f387db 100644
> --- a/src/lib/include/fwts_ac_adapter.h
> +++ b/src/lib/include/fwts_ac_adapter.h
> @@ -27,6 +27,6 @@
>   #define FWTS_AC_ADAPTER_ONLINE	(0x1)
>   #define FWTS_AC_ADAPTER_OFFLINE	(0x2)
>
> -int fwts_ac_adapter_get_state(int state, int *matching, int *not_matching);
> +int fwts_ac_adapter_get_state(const int state, int *matching, int *not_matching);
>
>   #endif
> diff --git a/src/lib/src/fwts_ac_adapter.c b/src/lib/src/fwts_ac_adapter.c
> index be07be8..9db1748 100644
> --- a/src/lib/src/fwts_ac_adapter.c
> +++ b/src/lib/src/fwts_ac_adapter.c
> @@ -70,7 +70,7 @@ static fwts_ac_interface_info fwts_ac_interfaces[] = {
>    *	not_matching is incremented for each AC adapter instance that does
>    *	not match.
>    */
> -int fwts_ac_adapter_get_state(int state, int *matching, int *not_matching)
> +int fwts_ac_adapter_get_state(const int state, int *matching, int *not_matching)
>   {
>   	DIR *ac_power_dir;
>   	struct dirent *entry;
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch

diff --git a/src/lib/include/fwts_ac_adapter.h b/src/lib/include/fwts_ac_adapter.h
index 905984f..9f387db 100644
--- a/src/lib/include/fwts_ac_adapter.h
+++ b/src/lib/include/fwts_ac_adapter.h
@@ -27,6 +27,6 @@ 
 #define FWTS_AC_ADAPTER_ONLINE	(0x1)
 #define FWTS_AC_ADAPTER_OFFLINE	(0x2)
 
-int fwts_ac_adapter_get_state(int state, int *matching, int *not_matching);
+int fwts_ac_adapter_get_state(const int state, int *matching, int *not_matching);
 
 #endif
diff --git a/src/lib/src/fwts_ac_adapter.c b/src/lib/src/fwts_ac_adapter.c
index be07be8..9db1748 100644
--- a/src/lib/src/fwts_ac_adapter.c
+++ b/src/lib/src/fwts_ac_adapter.c
@@ -70,7 +70,7 @@  static fwts_ac_interface_info fwts_ac_interfaces[] = {
  *	not_matching is incremented for each AC adapter instance that does
  *	not match.
  */
-int fwts_ac_adapter_get_state(int state, int *matching, int *not_matching)
+int fwts_ac_adapter_get_state(const int state, int *matching, int *not_matching)
 {
 	DIR *ac_power_dir;
 	struct dirent *entry;