Patchwork [10/11] lib: fwts_memorymap: constify function arguments where appropriate

login
register
mail settings
Submitter Colin King
Date Oct. 16, 2012, 7:20 p.m.
Message ID <1350415248-16965-11-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/191863/
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_memorymap.h |    2 +-
 src/lib/src/fwts_memorymap.c     |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Keng-Yu Lin - Oct. 18, 2012, 6:50 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_memorymap.h |    2 +-
>  src/lib/src/fwts_memorymap.c     |    4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/lib/include/fwts_memorymap.h b/src/lib/include/fwts_memorymap.h
> index b125ec0..ae94f85 100644
> --- a/src/lib/include/fwts_memorymap.h
> +++ b/src/lib/include/fwts_memorymap.h
> @@ -42,7 +42,7 @@ int        fwts_memory_map_is_reserved(fwts_list *memory_map_list, const uint64_
>  fwts_list *fwts_memory_map_table_load(fwts_framework *fw);
>  void       fwts_memory_map_table_free(fwts_list *memory_map_list);
>  void       fwts_memory_map_table_dump(fwts_framework *fw, fwts_list *memory_map_list);
> -const char *fwts_memory_map_name(int type);
> +const char *fwts_memory_map_name(const int type);
>  fwts_memory_map_entry *fwts_memory_map_info(fwts_list *memory_map_list, const uint64_t memory);
>
>  #endif
> diff --git a/src/lib/src/fwts_memorymap.c b/src/lib/src/fwts_memorymap.c
> index 46fe455..fe5dd7b 100644
> --- a/src/lib/src/fwts_memorymap.c
> +++ b/src/lib/src/fwts_memorymap.c
> @@ -77,7 +77,7 @@ static int fwts_memory_map_str_to_type(const char *str)
>   *  fwts_memory_map_type_to_str()
>   *     convert E280 type values to strings
>   */
> -static char *fwts_memory_map_type_to_str(int type)
> +static char *fwts_memory_map_type_to_str(const int type)
>  {
>         switch (type) {
>         case FWTS_MEMORY_MAP_RESERVED:
> @@ -320,7 +320,7 @@ void fwts_memory_map_table_free(fwts_list *memory_map_list)
>         fwts_list_free(memory_map_list, free);
>  }
>
> -const char *fwts_memory_map_name(int type)
> +const char *fwts_memory_map_name(const int type)
>  {
>         switch (type) {
>         case FWTS_FIRMWARE_BIOS:
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - Oct. 22, 2012, 9:34 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_memorymap.h |    2 +-
>   src/lib/src/fwts_memorymap.c     |    4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/lib/include/fwts_memorymap.h b/src/lib/include/fwts_memorymap.h
> index b125ec0..ae94f85 100644
> --- a/src/lib/include/fwts_memorymap.h
> +++ b/src/lib/include/fwts_memorymap.h
> @@ -42,7 +42,7 @@ int        fwts_memory_map_is_reserved(fwts_list *memory_map_list, const uint64_
>   fwts_list *fwts_memory_map_table_load(fwts_framework *fw);
>   void       fwts_memory_map_table_free(fwts_list *memory_map_list);
>   void       fwts_memory_map_table_dump(fwts_framework *fw, fwts_list *memory_map_list);
> -const char *fwts_memory_map_name(int type);
> +const char *fwts_memory_map_name(const int type);
>   fwts_memory_map_entry *fwts_memory_map_info(fwts_list *memory_map_list, const uint64_t memory);
>
>   #endif
> diff --git a/src/lib/src/fwts_memorymap.c b/src/lib/src/fwts_memorymap.c
> index 46fe455..fe5dd7b 100644
> --- a/src/lib/src/fwts_memorymap.c
> +++ b/src/lib/src/fwts_memorymap.c
> @@ -77,7 +77,7 @@ static int fwts_memory_map_str_to_type(const char *str)
>    *  fwts_memory_map_type_to_str()
>    *	convert E280 type values to strings
>    */
> -static char *fwts_memory_map_type_to_str(int type)
> +static char *fwts_memory_map_type_to_str(const int type)
>   {
>   	switch (type) {
>   	case FWTS_MEMORY_MAP_RESERVED:
> @@ -320,7 +320,7 @@ void fwts_memory_map_table_free(fwts_list *memory_map_list)
>   	fwts_list_free(memory_map_list, free);
>   }
>
> -const char *fwts_memory_map_name(int type)
> +const char *fwts_memory_map_name(const int type)
>   {
>   	switch (type) {
>   	case FWTS_FIRMWARE_BIOS:
>

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

Patch

diff --git a/src/lib/include/fwts_memorymap.h b/src/lib/include/fwts_memorymap.h
index b125ec0..ae94f85 100644
--- a/src/lib/include/fwts_memorymap.h
+++ b/src/lib/include/fwts_memorymap.h
@@ -42,7 +42,7 @@  int        fwts_memory_map_is_reserved(fwts_list *memory_map_list, const uint64_
 fwts_list *fwts_memory_map_table_load(fwts_framework *fw);
 void       fwts_memory_map_table_free(fwts_list *memory_map_list);
 void       fwts_memory_map_table_dump(fwts_framework *fw, fwts_list *memory_map_list);
-const char *fwts_memory_map_name(int type);
+const char *fwts_memory_map_name(const int type);
 fwts_memory_map_entry *fwts_memory_map_info(fwts_list *memory_map_list, const uint64_t memory);
 
 #endif
diff --git a/src/lib/src/fwts_memorymap.c b/src/lib/src/fwts_memorymap.c
index 46fe455..fe5dd7b 100644
--- a/src/lib/src/fwts_memorymap.c
+++ b/src/lib/src/fwts_memorymap.c
@@ -77,7 +77,7 @@  static int fwts_memory_map_str_to_type(const char *str)
  *  fwts_memory_map_type_to_str()
  *	convert E280 type values to strings
  */
-static char *fwts_memory_map_type_to_str(int type)
+static char *fwts_memory_map_type_to_str(const int type)
 {
 	switch (type) {
 	case FWTS_MEMORY_MAP_RESERVED:
@@ -320,7 +320,7 @@  void fwts_memory_map_table_free(fwts_list *memory_map_list)
 	fwts_list_free(memory_map_list, free);
 }
 
-const char *fwts_memory_map_name(int type)
+const char *fwts_memory_map_name(const int type)
 {
 	switch (type) {
 	case FWTS_FIRMWARE_BIOS: