diff mbox

hotkey: remove redundant framework parameter from hotkey_find_keyboard

Message ID 1350288572-15505-1-git-send-email-alex.hung@canonical.com
State Accepted
Headers show

Commit Message

Alex Hung Oct. 15, 2012, 8:09 a.m. UTC
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(-)

Comments

Colin Ian King Oct. 15, 2012, 8:21 a.m. UTC | #1
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. UTC | #2
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>
diff mbox

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;
 	}