Patchwork hotkey: remove redundant framework parameter from hotkey_find_keyboard

login
register
mail settings
Submitter Alex Hung
Date Oct. 15, 2012, 8:09 a.m.
Message ID <1350288572-15505-1-git-send-email-alex.hung@canonical.com>
Download mbox | patch
Permalink /patch/191488/
State Accepted
Headers show

Comments

Alex Hung - Oct. 15, 2012, 8:09 a.m.
We don't need to pass the fwts_framework pointer to hotkey_find_keyboard
so remove it.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/hotkey/hotkey/hotkey.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Colin King - Oct. 15, 2012, 8:21 a.m.
On 15/10/12 09:09, Alex Hung wrote:
> We don't need to pass the fwts_framework pointer to hotkey_find_keyboard
> so remove it.
>
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>   src/hotkey/hotkey/hotkey.c |    6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/hotkey/hotkey/hotkey.c b/src/hotkey/hotkey/hotkey.c
> index 7602e89..53b9208 100644
> --- a/src/hotkey/hotkey/hotkey.c
> +++ b/src/hotkey/hotkey/hotkey.c
> @@ -136,7 +136,7 @@ static char *hotkey_device(char *path)
>   	return dev;
>   }
>
> -static char *hotkey_find_keyboard(fwts_framework *fw, char *path)
> +static char *hotkey_find_keyboard(char *path)
>   {
>   	DIR *dir;
>   	struct dirent *entry;
> @@ -155,7 +155,7 @@ static char *hotkey_find_keyboard(fwts_framework *fw, char *path)
>   			lstat(filename, &statbuf);
>   			if (S_ISDIR(statbuf.st_mode)) {
>   				if (!S_ISLNK(statbuf.st_mode))
> -					if ((dev = hotkey_find_keyboard(fw, filename)) != NULL)
> +					if ((dev = hotkey_find_keyboard(filename)) != NULL)
>   						break;
>   			} else {
>   				if ((data = fwts_get(filename)) != NULL) {
> @@ -206,7 +206,7 @@ static char *hotkey_find_keymap(char *device)
>
>   static int hotkey_init(fwts_framework *fw)
>   {
> -	if ((hotkey_dev = hotkey_find_keyboard(fw, "/sys/devices/platform")) == NULL) {
> +	if ((hotkey_dev = hotkey_find_keyboard("/sys/devices/platform")) == NULL) {
>   		fwts_log_error(fw, "Cannot find keyboard for this machine.");
>   		return FWTS_ERROR;
>   	}
>
Acked-by: Colin Ian King <colin.king@canonical.com>
Keng-Yu Lin - Oct. 17, 2012, 8:16 a.m.
On Mon, Oct 15, 2012 at 4:09 PM, Alex Hung <alex.hung@canonical.com> wrote:
> We don't need to pass the fwts_framework pointer to hotkey_find_keyboard
> so remove it.
>
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/hotkey/hotkey/hotkey.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/hotkey/hotkey/hotkey.c b/src/hotkey/hotkey/hotkey.c
> index 7602e89..53b9208 100644
> --- a/src/hotkey/hotkey/hotkey.c
> +++ b/src/hotkey/hotkey/hotkey.c
> @@ -136,7 +136,7 @@ static char *hotkey_device(char *path)
>         return dev;
>  }
>
> -static char *hotkey_find_keyboard(fwts_framework *fw, char *path)
> +static char *hotkey_find_keyboard(char *path)
>  {
>         DIR *dir;
>         struct dirent *entry;
> @@ -155,7 +155,7 @@ static char *hotkey_find_keyboard(fwts_framework *fw, char *path)
>                         lstat(filename, &statbuf);
>                         if (S_ISDIR(statbuf.st_mode)) {
>                                 if (!S_ISLNK(statbuf.st_mode))
> -                                       if ((dev = hotkey_find_keyboard(fw, filename)) != NULL)
> +                                       if ((dev = hotkey_find_keyboard(filename)) != NULL)
>                                                 break;
>                         } else {
>                                 if ((data = fwts_get(filename)) != NULL) {
> @@ -206,7 +206,7 @@ static char *hotkey_find_keymap(char *device)
>
>  static int hotkey_init(fwts_framework *fw)
>  {
> -       if ((hotkey_dev = hotkey_find_keyboard(fw, "/sys/devices/platform")) == NULL) {
> +       if ((hotkey_dev = hotkey_find_keyboard("/sys/devices/platform")) == NULL) {
>                 fwts_log_error(fw, "Cannot find keyboard for this machine.");
>                 return FWTS_ERROR;
>         }
> --
> 1.7.9.5
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/hotkey/hotkey/hotkey.c b/src/hotkey/hotkey/hotkey.c
index 7602e89..53b9208 100644
--- a/src/hotkey/hotkey/hotkey.c
+++ b/src/hotkey/hotkey/hotkey.c
@@ -136,7 +136,7 @@  static char *hotkey_device(char *path)
 	return dev;
 }
 
-static char *hotkey_find_keyboard(fwts_framework *fw, char *path)
+static char *hotkey_find_keyboard(char *path)
 {
 	DIR *dir;
 	struct dirent *entry;
@@ -155,7 +155,7 @@  static char *hotkey_find_keyboard(fwts_framework *fw, char *path)
 			lstat(filename, &statbuf);
 			if (S_ISDIR(statbuf.st_mode)) {
 				if (!S_ISLNK(statbuf.st_mode))
-					if ((dev = hotkey_find_keyboard(fw, filename)) != NULL)
+					if ((dev = hotkey_find_keyboard(filename)) != NULL)
 						break;
 			} else {
 				if ((data = fwts_get(filename)) != NULL) {
@@ -206,7 +206,7 @@  static char *hotkey_find_keymap(char *device)
 
 static int hotkey_init(fwts_framework *fw)
 {
-	if ((hotkey_dev = hotkey_find_keyboard(fw, "/sys/devices/platform")) == NULL) {
+	if ((hotkey_dev = hotkey_find_keyboard("/sys/devices/platform")) == NULL) {
 		fwts_log_error(fw, "Cannot find keyboard for this machine.");
 		return FWTS_ERROR;
 	}