diff mbox series

bios: bios_info: make struct fields const

Message ID 20210412090705.1264756-1-colin.king@canonical.com
State Accepted
Headers show
Series bios: bios_info: make struct fields const | expand

Commit Message

Colin Ian King April 12, 2021, 9:07 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The struct fields are read-only, so make them const

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/bios/bios_info/bios_info.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alex Hung April 12, 2021, 7:43 p.m. UTC | #1
On 2021-04-12 3:07 a.m., Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The struct fields are read-only, so make them const
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/bios/bios_info/bios_info.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/bios/bios_info/bios_info.c b/src/bios/bios_info/bios_info.c
> index 60f69f86..45dd9e03 100644
> --- a/src/bios/bios_info/bios_info.c
> +++ b/src/bios/bios_info/bios_info.c
> @@ -25,8 +25,8 @@
>  #include <limits.h>
>  
>  typedef struct {
> -	char *dmi_field;
> -	char *label;
> +	const char *dmi_field;
> +	const char *label;
>  } fwts_bios_info;
>  
>  static const fwts_bios_info bios_info[] = {
> 


Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu April 21, 2021, 7:09 a.m. UTC | #2
On 4/12/21 5:07 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The struct fields are read-only, so make them const
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/bios/bios_info/bios_info.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/bios/bios_info/bios_info.c b/src/bios/bios_info/bios_info.c
> index 60f69f86..45dd9e03 100644
> --- a/src/bios/bios_info/bios_info.c
> +++ b/src/bios/bios_info/bios_info.c
> @@ -25,8 +25,8 @@
>  #include <limits.h>
>  
>  typedef struct {
> -	char *dmi_field;
> -	char *label;
> +	const char *dmi_field;
> +	const char *label;
>  } fwts_bios_info;
>  
>  static const fwts_bios_info bios_info[] = {
> 


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

Patch

diff --git a/src/bios/bios_info/bios_info.c b/src/bios/bios_info/bios_info.c
index 60f69f86..45dd9e03 100644
--- a/src/bios/bios_info/bios_info.c
+++ b/src/bios/bios_info/bios_info.c
@@ -25,8 +25,8 @@ 
 #include <limits.h>
 
 typedef struct {
-	char *dmi_field;
-	char *label;
+	const char *dmi_field;
+	const char *label;
 } fwts_bios_info;
 
 static const fwts_bios_info bios_info[] = {