]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DOC: update coding-style to reference checkpatch.pl
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Sep 2015 14:36:15 +0000 (16:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 21 Sep 2015 14:45:45 +0000 (16:45 +0200)
commit8f1b35b383b5911e9fd1ac4ff0a1aab244406575
tree977eb0737661dd7c6efb9c61d35b5b9d6c27570b
parent37bb7be09cfd966ea4cc0397bdb89eccd4a67dcc
DOC: update coding-style to reference checkpatch.pl

Running the Linux kernel's checkpatch.pl is actually quite efficient
at spotting style issues and even sometimes bugs. The doc now suggests
how to use it to avoid the warnings that are specific to Linux's stricter
rules.

It properly reports errors like the following ones that were found on
real submissions so it should improve the situation for everyone :

ERROR: "foo * bar" should be "foo *bar"
+static char * tcpcheck_get_step_comment(struct check *, int);

ERROR: do not use assignment in if condition
+                       if ((comment = tcpcheck_get_step_comment(check, step)))

WARNING: trailing semicolon indicates no statements, indent implies otherwise
+                       if (elem->data && elem->free);
+                               elem->free(elem->data);

ERROR: do not initialise statics to 0 or NULL
+static struct lru64_head *ssl_ctx_lru_tree = NULL;

ERROR: space required after that ',' (ctx:VxV)
+           !X509_gmtime_adj(X509_get_notAfter(newcrt),(long)60*60*24*365))
                                                      ^
WARNING: space prohibited between function name and open parenthesis '('
+       else if (EVP_PKEY_type (capkey->type) == EVP_PKEY_RSA)

ERROR: trailing statements should be on next line
+       if (cacert) X509_free(cacert);

ERROR: space prohibited after that open parenthesis '('
+                                       !(         (srv_op_state == SRV_ST_STOPPED)
doc/coding-style.txt