[PATCH] src/acpi/brightness: constify sys_path and return of brightness_get_path

Colin King colin.king at canonical.com
Mon Sep 4 12:14:21 UTC 2017


From: Colin Ian King <colin.king at canonical.com>

Add in a couple of constifications to some static data

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/acpi/brightness/brightness-helper.c | 6 +++---
 src/acpi/brightness/brightness-helper.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/acpi/brightness/brightness-helper.c b/src/acpi/brightness/brightness-helper.c
index bfadd22c..58a55538 100644
--- a/src/acpi/brightness/brightness-helper.c
+++ b/src/acpi/brightness/brightness-helper.c
@@ -32,7 +32,7 @@
  */
 
 static DIR *brightness_dir;
-static char *brightness_path;
+static const char *brightness_path;
 
 /*
  *  brightness_get_dir()
@@ -47,7 +47,7 @@ DIR *brightness_get_dir(void)
  *  brightness_get_path()
  *
  */
-char *brightness_get_path(void)
+const char *brightness_get_path(void)
 {
 	return brightness_path;
 }
@@ -60,7 +60,7 @@ char *brightness_get_path(void)
 int brightness_init(fwts_framework *fw)
 {
 	int i;
-	static char *sys_path[] = {
+	static const char *sys_path[] = {
 		"/sys/class/backlight",
 		"/sys/devices/virtual/backlight",
 		NULL
diff --git a/src/acpi/brightness/brightness-helper.h b/src/acpi/brightness/brightness-helper.h
index fb60204e..9d12ba8b 100644
--- a/src/acpi/brightness/brightness-helper.h
+++ b/src/acpi/brightness/brightness-helper.h
@@ -24,7 +24,7 @@
 #include <dirent.h>
 
 DIR *brightness_get_dir(void);
-char *brightness_get_path(void);
+const char *brightness_get_path(void);
 int brightness_init(fwts_framework *fw);
 int brightness_deinit(fwts_framework *fw);
 int brightness_get_setting(const char *entry_name, const char *setting, int *value);
-- 
2.14.1




More information about the fwts-devel mailing list