[PATCH 06/11] lib: fwts_button: constify function arguments where appropriate

Keng-Yu Lin kengyu at canonical.com
Thu Oct 18 06:49:41 UTC 2012


On Wed, Oct 17, 2012 at 3:20 AM, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/lib/include/fwts_button.h |    2 +-
>  src/lib/src/fwts_button.c     |   11 +++++++++--
>  2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/src/lib/include/fwts_button.h b/src/lib/include/fwts_button.h
> index 56a4bdf..5c70cc5 100644
> --- a/src/lib/include/fwts_button.h
> +++ b/src/lib/include/fwts_button.h
> @@ -26,6 +26,6 @@
>
>  #define FWTS_BUTTON_POWER_EXISTS       (0x00010)
>
> -int fwts_button_match_state(fwts_framework *fw, int button, int *matched, int *not_matched);
> +int fwts_button_match_state(fwts_framework *fw, const int button, int *matched, int *not_matched);
>
>  #endif
> diff --git a/src/lib/src/fwts_button.c b/src/lib/src/fwts_button.c
> index c410d5f..2eb7d87 100644
> --- a/src/lib/src/fwts_button.c
> +++ b/src/lib/src/fwts_button.c
> @@ -34,7 +34,10 @@
>   *     find matching button state and keep count of matching
>   *     any non-matching states found, via proc iterface
>   */
> -static int fwts_button_match_state_proc(int button, int *matched, int *not_matched)
> +static int fwts_button_match_state_proc(
> +       const int button,
> +       int *matched,
> +       int *not_matched)
>  {
>         DIR *dir;
>         struct dirent *entry;
> @@ -106,7 +109,11 @@ static int fwts_button_match_state_proc(int button, int *matched, int *not_match
>   *     matched is a count of any button states that match, and not_matched
>   *     is a count of any button states that don't match.
>   */
> -int fwts_button_match_state(fwts_framework *fw, int button, int *matched, int *not_matched)
> +int fwts_button_match_state(
> +       fwts_framework *fw,
> +       const int button,
> +       int *matched,
> +       int *not_matched)
>  {
>         *matched = 0;
>         *not_matched = 0;
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>



More information about the fwts-devel mailing list