Use cstyle -cpP in make cstyle check

Enable picky cstyle checks and resolve the new warnings.  The vast
majority of the changes needed were to handle minor issues with
whitespace formatting.  This patch contains no functional changes.

Non-whitespace changes are as follows:

* 8 times ; to { } in for/while loop
* fix missing ; in cmd/zed/agents/zfs_diagnosis.c
* comment (confim -> confirm)
* change endline , to ; in cmd/zpool/zpool_main.c
* a number of /* BEGIN CSTYLED */ /* END CSTYLED */ blocks
* /* CSTYLED */ markers
* change == 0 to !
* ulong to unsigned long in module/zfs/dsl_scan.c
* rearrangement of module_param lines in module/zfs/metaslab.c
* add { } block around statement after for_each_online_node

Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Håkan Johansson <f96hajo@chalmers.se>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #5465
This commit is contained in:
Brian Behlendorf
2016-12-12 10:46:26 -08:00
committed by GitHub
parent d57f03e40e
commit 02730c333c
96 changed files with 501 additions and 478 deletions
+5 -5
View File
@@ -608,7 +608,7 @@ fletcher_4_kstat_data(char *buf, size_t size, void *data)
{
struct fletcher_4_kstat *fastest_stat =
&fletcher_4_stat_data[fletcher_4_supp_impls_cnt];
struct fletcher_4_kstat *curr_stat = (struct fletcher_4_kstat *) data;
struct fletcher_4_kstat *curr_stat = (struct fletcher_4_kstat *)data;
ssize_t off = 0;
if (curr_stat == fastest_stat) {
@@ -623,9 +623,9 @@ fletcher_4_kstat_data(char *buf, size_t size, void *data)
off += snprintf(buf + off, size - off, "%-17s",
fletcher_4_supp_impls[id]->name);
off += snprintf(buf + off, size - off, "%-15llu",
(u_longlong_t) curr_stat->native);
(u_longlong_t)curr_stat->native);
off += snprintf(buf + off, size - off, "%-15llu\n",
(u_longlong_t) curr_stat->byteswap);
(u_longlong_t)curr_stat->byteswap);
}
return (0);
@@ -723,7 +723,7 @@ fletcher_4_init(void)
/* move supported impl into fletcher_4_supp_impls */
for (i = 0, c = 0; i < ARRAY_SIZE(fletcher_4_impls); i++) {
curr_impl = (fletcher_4_ops_t *) fletcher_4_impls[i];
curr_impl = (fletcher_4_ops_t *)fletcher_4_impls[i];
if (curr_impl->valid && curr_impl->valid())
fletcher_4_supp_impls[c++] = curr_impl;
@@ -754,7 +754,7 @@ fletcher_4_init(void)
/* install kstats for all implementations */
fletcher_4_kstat = kstat_create("zfs", 0, "fletcher_4_bench", "misc",
KSTAT_TYPE_RAW, 0, KSTAT_FLAG_VIRTUAL);
KSTAT_TYPE_RAW, 0, KSTAT_FLAG_VIRTUAL);
if (fletcher_4_kstat != NULL) {
fletcher_4_kstat->ks_data = NULL;
fletcher_4_kstat->ks_ndata = UINT32_MAX;
+2 -2
View File
@@ -193,7 +193,7 @@ uio_prefaultpages(ssize_t n, struct uio *uio)
*/
p = iov->iov_base + skip;
while (cnt) {
if (fuword8((uint8_t *) p, &tmp))
if (fuword8((uint8_t *)p, &tmp))
return;
incr = MIN(cnt, PAGESIZE);
p += incr;
@@ -203,7 +203,7 @@ uio_prefaultpages(ssize_t n, struct uio *uio)
* touch the last byte in case it straddles a page.
*/
p--;
if (fuword8((uint8_t *) p, &tmp))
if (fuword8((uint8_t *)p, &tmp))
return;
}
}