diff options
author | LiXin <li.xin@linaro.org> | 2013-04-03 09:46:35 +0800 |
---|---|---|
committer | Guodong Xu <guodong.xu@linaro.org> | 2013-04-03 13:31:34 +0800 |
commit | ffbcffff5119ff419a54a1c20c9250301e7bff48 (patch) | |
tree | d21d670f70a2f1beb91c4f5a1f279c1b8c14b9d4 | |
parent | 1c02813ecc3191ecec2d4794d39da1758446c195 (diff) |
ARM: Hi3620: Fix some coding style warnings
Fix some warnings and errors regarding checkpatch.pl
Signed-off-by: LiXin <li.xin@linaro.org>
-rwxr-xr-x | drivers/input/keyboard/k3_keypad.c | 36 | ||||
-rw-r--r-- | drivers/input/keyboard/k3_keypad.h | 9 |
2 files changed, 27 insertions, 18 deletions
diff --git a/drivers/input/keyboard/k3_keypad.c b/drivers/input/keyboard/k3_keypad.c index b8b1c682eb8..c4944943fc7 100755 --- a/drivers/input/keyboard/k3_keypad.c +++ b/drivers/input/keyboard/k3_keypad.c @@ -45,7 +45,7 @@ #define KPC_BIT_PER_KEYROW (3) /*KPC clock frequency*/ -#define KPC_CLK_RATE (32768) +#define KPC_CLK_RATE (32768) /*KPC Register Offset*/ #define KPC_CONTROL_OFFSET (0x000) @@ -63,8 +63,10 @@ #define KPC_RELEASE_INT_BITPOS (30) /*REG config value */ -#define KPC_VAL_CTLREG (0x023) /* [8:0]: 0_0000_0011 */ -#define KPC_VAL_SHORT_INTERVAL (0x28) /* 120 x 250us = 30ms */ +/* [8:0]: 0_0000_0011 */ +#define KPC_VAL_CTLREG (0x023) +/* 120 x 250us = 30ms */ +#define KPC_VAL_SHORT_INTERVAL (0x28) struct k3v2_keypad { struct input_dev *input_dev; @@ -74,9 +76,12 @@ struct k3v2_keypad { int rows; int cols; int row_shift; - unsigned short keycodes[KPC_MAX_ROWS * KPC_MAX_COLS]; /* Used for keymap*/ - unsigned char scancode_state[KPC_MAX_ROWS]; /* Used for result of keypad scan*/ - uint16_t keycode_state[KPC_MAX_ROWS * 2]; /* Used for store all keycode state*/ + /* Used for keymap*/ + unsigned short keycodes[KPC_MAX_ROWS * KPC_MAX_COLS]; + /* Used for result of keypad scan*/ + unsigned char scancode_state[KPC_MAX_ROWS]; + /* Used for store all keycode state*/ + uint16_t keycode_state[KPC_MAX_ROWS * 2]; }; @@ -89,8 +94,8 @@ static int k3v2_keypad_open(struct input_dev *dev) struct pinctrl *block = NULL; int ret = 0; - if(keypad == NULL){ - printk(KERN_ERR "get invalid keypad pointer\n"); + if (keypad == NULL) { + dev_err(dev, "get invalid keypad pointer\n"); return -EINVAL; } @@ -105,7 +110,8 @@ static int k3v2_keypad_open(struct input_dev *dev) /*config KPC_CONTROL REG*/ writel(KPC_VAL_CTLREG, keypad->base + KPC_CONTROL_OFFSET); /*config KPC_INTERVAL_SHORT REG*/ - writel(KPC_VAL_SHORT_INTERVAL, keypad->base + KPC_INTERVAL_SHORT_OFFSET); + writel(KPC_VAL_SHORT_INTERVAL, + keypad->base + KPC_INTERVAL_SHORT_OFFSET); enable_irq(keypad->irq); return ret; @@ -115,8 +121,8 @@ static void k3v2_keypad_close(struct input_dev *dev) { struct k3v2_keypad *keypad = input_get_drvdata(dev); - if(keypad == NULL){ - printk(KERN_ERR "get invalid keypad pointer\n"); + if (keypad == NULL) { + dev_err(dev, "get invalid keypad pointer\n"); return; } @@ -413,7 +419,7 @@ static const struct of_device_id keypad_match[] = { MODULE_DEVICE_TABLE(of, keypad_match); #endif -static int k3v2_keypad_probe(struct platform_device* pdev) +static int k3v2_keypad_probe(struct platform_device *pdev) { const struct k3v2_keypad_platdata *platdata; const struct matrix_keymap_data *keymap_data; @@ -450,7 +456,7 @@ static int k3v2_keypad_probe(struct platform_device* pdev) } keypad = kzalloc(sizeof(struct k3v2_keypad) , GFP_KERNEL); - if(!keypad) { + if (!keypad) { dev_err(&pdev->dev, "Failed to allocate struct k3v2_keypad!\n"); err = -ENOMEM; } @@ -578,8 +584,8 @@ static int k3v2_keypad_remove(struct platform_device* pdev) { struct k3v2_keypad *keypad = platform_get_drvdata(pdev); - if(keypad == NULL){ - printk(KERN_ERR "get invalid keypad pointer\n"); + if (keypad == NULL) { + dev_err(dev, "get invalid keypad pointer\n"); return -EINVAL; } diff --git a/drivers/input/keyboard/k3_keypad.h b/drivers/input/keyboard/k3_keypad.h index 734d4c0d83f..9e8ed9dcfe2 100644 --- a/drivers/input/keyboard/k3_keypad.h +++ b/drivers/input/keyboard/k3_keypad.h @@ -4,9 +4,12 @@ #define DPAD_CENTER 232 -#define KEYPAD_CHECK_KEYCODE(map, keycode) (map[(keycode) >> 4] & (1 << ((keycode) & 0x0F))) -#define KEYPAD_SET_KEYCODE(map, keycode) (map[(keycode) >> 4] |= (1 << ((keycode) & 0x0F))) -#define KEYPAD_CLR_KEYCODE(map, keycode) (map[(keycode) >> 4] &= ~(1 << ((keycode) & 0x0F))) +#define KEYPAD_CHECK_KEYCODE(map, keycode) \ + (map[(keycode) >> 4] & (1 << ((keycode) & 0x0F))) +#define KEYPAD_SET_KEYCODE(map, keycode) \ + (map[(keycode) >> 4] |= (1 << ((keycode) & 0x0F))) +#define KEYPAD_CLR_KEYCODE(map, keycode) \ + (map[(keycode) >> 4] &= ~(1 << ((keycode) & 0x0F))) struct k3v2_keypad_platdata { |