From: Jim Huang Date: Sat, 7 Aug 2021 15:33:37 +0000 (+0800) Subject: Enforce consistent style X-Git-Tag: latest~185 X-Git-Url: https://www.ivnss.com/gitweb/?a=commitdiff_plain;h=a26d93037e2a6ec5bc3d71c0244d26a1a4fc5973;p=lkmpg Enforce consistent style Execute "make indent" before submitting patches. --- diff --git a/Makefile b/Makefile index a784b3a..2622d90 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,9 @@ html: lkmpg.tex html.cfg ln -sf lkmpg.html html/index.html rm -f lkmpg.xref lkmpg.tmp lkmpg.html lkmpg.css lkmpg.4ct lkmpg.4tc lkmpg.dvi lkmpg.lg lkmpg.idv lkmpg*.svg lkmpg.log lkmpg.aux +indent: + (cd examples; find . -name '*.[ch]' | xargs clang-format -i) + clean: rm -f *.dvi *.aux *.log *.ps *.pdf *.out lkmpg.bbl lkmpg.blg lkmpg.lof lkmpg.toc rm -rf _minted-lkmpg diff --git a/examples/procfs1.c b/examples/procfs1.c index 6d23b1e..001d50b 100644 --- a/examples/procfs1.c +++ b/examples/procfs1.c @@ -27,10 +27,9 @@ ssize_t procfile_read(struct file *filePointer, ssize_t ret = len; if (*offset >= len || copy_to_user(buffer, s, len)) { - pr_info("copy_to_user failed\n"); - ret = 0; - } - else { + pr_info("copy_to_user failed\n"); + ret = 0; + } else { pr_info("procfile read %s\n", filePointer->f_path.dentry->d_name.name); *offset += len; } diff --git a/examples/procfs2.c b/examples/procfs2.c index 842dd6d..43ff27f 100644 --- a/examples/procfs2.c +++ b/examples/procfs2.c @@ -47,10 +47,9 @@ ssize_t procfile_read(struct file *filePointer, ssize_t ret = len; if (*offset >= len || copy_to_user(buffer, s, len)) { - pr_info("copy_to_user failed\n"); - ret = 0; - } - else { + pr_info("copy_to_user failed\n"); + ret = 0; + } else { pr_info("procfile read %s\n", filePointer->f_path.dentry->d_name.name); *offset += len; }