Make Linux kernel coding style modifications for XGI_main_26.c to include:
Spaces around operators
Blank lines before }
Logical continuation
Comment modifications
Align on parenthesis
Walt Feasel (5):
staging: speakup: synth.c Spaces around operators
staging: speakup: synth.c Blank line before }
staging: speakup: synth.c Logical continuation
staging: speakup: synth.c Comment modifications
staging: speakup: synth.c Align parenthesis
drivers/staging/speakup/synth.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
--
v2 makes changes to correct for email format patch submission
2.1.4
Make suggested checkpatch modification for
CHECK: spaces preferred around that '+,|,-,/'
Signed-off-by: Walt Feasel <[email protected]>
---
v2 makes changes to correct for email format patch submission
drivers/staging/speakup/synth.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
index 54b2f39..9c73a33 100644
--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -1,4 +1,4 @@
-#include <linux/types.h>
+w#include <linux/types.h>
#include <linux/ctype.h> /* for isdigit() and friends */
#include <linux/fs.h>
#include <linux/mm.h> /* for verify_area */
@@ -303,11 +303,11 @@ void spk_get_index_count(int *linecount, int *sentcount)
sentence_count = ind % 10;
if ((ind / 10) <= synth->indexing.currindex)
- index_count = synth->indexing.currindex-(ind/10);
+ index_count = synth->indexing.currindex - (ind / 10);
else
index_count = synth->indexing.currindex
- -synth->indexing.lowindex
- + synth->indexing.highindex-(ind/10)+1;
+ - synth->indexing.lowindex
+ + synth->indexing.highindex - (ind / 10) + 1;
}
*sentcount = sentence_count;
@@ -476,10 +476,10 @@ void synth_remove(struct spk_synth *in_synth)
break;
}
for ( ; synths[i] != NULL; i++) /* compress table */
- synths[i] = synths[i+1];
+ synths[i] = synths[i + 1];
module_status = 0;
mutex_unlock(&spk_mutex);
}
EXPORT_SYMBOL_GPL(synth_remove);
-short spk_punc_masks[] = { 0, SOME, MOST, PUNC, PUNC|B_SYM };
+short spk_punc_masks[] = { 0, SOME, MOST, PUNC, PUNC | B_SYM };
--
2.1.4
Make suggested checkpatch modification for
CHECK: Logical continuations should be on the
previous line
Signed-off-by: Walt Feasel <[email protected]>
---
v2 makes changes to correct for email format patch submission
drivers/staging/speakup/synth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
index 9191a6d..99d5cba 100644
--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -405,8 +405,8 @@ static int do_synth_init(struct spk_synth *in_synth)
speakup_register_var(var);
if (!spk_quiet_boot)
synth_printf("%s found\n", synth->long_name);
- if (synth->attributes.name
- && sysfs_create_group(speakup_kobj, &synth->attributes) < 0)
+ if (synth->attributes.name && sysfs_create_group(speakup_kobj,
+ &synth->attributes) < 0)
return -ENOMEM;
synth_flags = synth->flags;
wake_up_interruptible_all(&speakup_event);
--
2.1.4
Make suggested checkpatch modification for
CHECK: Alignment should match open parenthesis
Signed-off-by: Walt Feasel <[email protected]>
---
v2 makes changes to correct for email format patch submission
drivers/staging/speakup/synth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
index 779b918..2821a2b2 100644
--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -67,7 +67,7 @@ int spk_serial_synth_probe(struct spk_synth *synth)
return -ENODEV;
}
pr_info("%s: ttyS%i, Driver Version %s\n",
- synth->long_name, synth->ser, synth->version);
+ synth->long_name, synth->ser, synth->version);
synth->alive = 1;
return 0;
}
--
2.1.4
Make suggested checkpatch modification for
CHECK: Blank lines aren't necessary before a close brace '}'
Signed-off-by: Walt Feasel <[email protected]>
---
v2 makes changes to correct for email format patch submission
drivers/staging/speakup/synth.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
index 9c73a33..9191a6d 100644
--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -308,7 +308,6 @@ void spk_get_index_count(int *linecount, int *sentcount)
index_count = synth->indexing.currindex
- synth->indexing.lowindex
+ synth->indexing.highindex - (ind / 10) + 1;
-
}
*sentcount = sentence_count;
*linecount = index_count;
--
2.1.4
Make modifications to comment style
Signed-off-by: Walt Feasel <[email protected]>
---
v2 makes changes to correct for email format patch submission
drivers/staging/speakup/synth.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
index 99d5cba..779b918 100644
--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -8,7 +8,7 @@ w#include <linux/types.h>
#include <linux/delay.h> /* for loops_per_sec */
#include <linux/kmod.h>
#include <linux/jiffies.h>
-#include <linux/uaccess.h> /* for copy_from_user */
+#include <linux/uaccess.h> /* for copy_from_user */
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/kthread.h>
@@ -73,7 +73,8 @@ int spk_serial_synth_probe(struct spk_synth *synth)
}
EXPORT_SYMBOL_GPL(spk_serial_synth_probe);
-/* Main loop of the progression thread: keep eating from the buffer
+/*
+ * Main loop of the progression thread: keep eating from the buffer
* and push to the serial port, waiting as needed
*
* For devices that have a "full" notification mechanism, the driver can
--
2.1.4
Hi Walt,
[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.9-rc5 next-20161117]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Walt-Feasel/staging-speakup-synth-c-checkpatch-modifications/20161120-013925
config: i386-randconfig-x006-201647 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All error/warnings (new ones prefixed by >>):
>> drivers/staging/speakup/synth.c:1:2: error: stray '#' in program
w#include <linux/types.h>
^
>> drivers/staging/speakup/synth.c:1:1: error: unknown type name 'w'
w#include <linux/types.h>
^
>> drivers/staging/speakup/synth.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
w#include <linux/types.h>
^
In file included from drivers/staging/speakup/synth.c:2:0:
include/linux/ctype.h: In function '__tolower':
>> include/linux/ctype.h:20:22: error: '_ctype' undeclared (first use in this function)
#define __ismask(x) (_ctype[(int)(unsigned char)(x)])
^
>> include/linux/ctype.h:35:22: note: in expansion of macro '__ismask'
#define isupper(c) ((__ismask(c)&(_U)) != 0)
^~~~~~~~
>> include/linux/ctype.h:43:6: note: in expansion of macro 'isupper'
if (isupper(c))
^~~~~~~
include/linux/ctype.h:20:22: note: each undeclared identifier is reported only once for each function it appears in
#define __ismask(x) (_ctype[(int)(unsigned char)(x)])
^
>> include/linux/ctype.h:35:22: note: in expansion of macro '__ismask'
#define isupper(c) ((__ismask(c)&(_U)) != 0)
^~~~~~~~
>> include/linux/ctype.h:43:6: note: in expansion of macro 'isupper'
if (isupper(c))
^~~~~~~
include/linux/ctype.h: In function '__toupper':
>> include/linux/ctype.h:20:22: error: '_ctype' undeclared (first use in this function)
#define __ismask(x) (_ctype[(int)(unsigned char)(x)])
^
include/linux/ctype.h:30:22: note: in expansion of macro '__ismask'
#define islower(c) ((__ismask(c)&(_L)) != 0)
^~~~~~~~
>> include/linux/ctype.h:50:6: note: in expansion of macro 'islower'
if (islower(c))
^~~~~~~
vim +1 drivers/staging/speakup/synth.c
> 1 w#include <linux/types.h>
2 #include <linux/ctype.h> /* for isdigit() and friends */
3 #include <linux/fs.h>
4 #include <linux/mm.h> /* for verify_area */
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Hi Walt,
[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.9-rc5 next-20161117]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Walt-Feasel/staging-speakup-synth-c-checkpatch-modifications/20161120-013925
config: openrisc-allmodconfig (attached as .config)
compiler: or32-linux-gcc (GCC) 4.5.1-or32-1.0rc1
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=openrisc
All errors (new ones prefixed by >>):
drivers/staging/speakup/synth.c:1:1: error: stray '#' in program
>> drivers/staging/speakup/synth.c:1:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'include'
In file included from drivers/staging/speakup/synth.c:2:0:
include/linux/ctype.h: In function '__tolower':
include/linux/ctype.h:43:6: error: '_ctype' undeclared (first use in this function)
include/linux/ctype.h:43:6: note: each undeclared identifier is reported only once for each function it appears in
include/linux/ctype.h: In function '__toupper':
include/linux/ctype.h:50:6: error: '_ctype' undeclared (first use in this function)
vim +1 drivers/staging/speakup/synth.c
> 1 w#include <linux/types.h>
2 #include <linux/ctype.h> /* for isdigit() and friends */
3 #include <linux/fs.h>
4 #include <linux/mm.h> /* for verify_area */
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Make suggested checkpatch modification for
CHECK: spaces preferred around that '|,+,-,/'
Signed-off-by: Walt Feasel <[email protected]>
---
v3 fixes erroneous w added in v2
drivers/staging/speakup/synth.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
index 54b2f39..17aa440 100644
--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -303,11 +303,11 @@ void spk_get_index_count(int *linecount, int *sentcount)
sentence_count = ind % 10;
if ((ind / 10) <= synth->indexing.currindex)
- index_count = synth->indexing.currindex-(ind/10);
+ index_count = synth->indexing.currindex - (ind / 10);
else
index_count = synth->indexing.currindex
- -synth->indexing.lowindex
- + synth->indexing.highindex-(ind/10)+1;
+ - synth->indexing.lowindex
+ + synth->indexing.highindex - (ind / 10) + 1;
}
*sentcount = sentence_count;
@@ -476,10 +476,10 @@ void synth_remove(struct spk_synth *in_synth)
break;
}
for ( ; synths[i] != NULL; i++) /* compress table */
- synths[i] = synths[i+1];
+ synths[i] = synths[i + 1];
module_status = 0;
mutex_unlock(&spk_mutex);
}
EXPORT_SYMBOL_GPL(synth_remove);
-short spk_punc_masks[] = { 0, SOME, MOST, PUNC, PUNC|B_SYM };
+short spk_punc_masks[] = { 0, SOME, MOST, PUNC, PUNC | B_SYM };
--
2.1.4
On Sat, Nov 19, 2016 at 12:35:43PM -0500, Walt Feasel wrote:
> Make suggested checkpatch modification for
> CHECK: spaces preferred around that '+,|,-,/'
>
> Signed-off-by: Walt Feasel <[email protected]>
> ---
> v2 makes changes to correct for email format patch submission
>
> drivers/staging/speakup/synth.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
> index 54b2f39..9c73a33 100644
> --- a/drivers/staging/speakup/synth.c
> +++ b/drivers/staging/speakup/synth.c
> @@ -1,4 +1,4 @@
> -#include <linux/types.h>
> +w#include <linux/types.h>
This is a mistake.
regards,
dan carpenter