From: "Robert P. J. Day" <rpjday@mindspring.com>
To: Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: my handy-dandy, "coding style" script
Date: Tue, 19 Dec 2006 10:46:24 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.64.0612191044170.7588@localhost.localdomain> (raw)
just for fun, i threw the following together to peruse the tree (or
any subdirectory) and look for stuff that violates the CodingStyle
guide. clearly, it's far from complete and very ad hoc, but it's
amusing. extra searches happily accepted.
rday
#!/bin/sh
DIR=${1-.}
echo -e "\n===== Deprecated 'depends' in Kconfig files ...\n"
grep depends $(find . -name Kconfig) | grep -v "depends on"
echo -e "\n===== Potentially unnecessary casting of k[cmz]alloc() calls ...\n"
grep -Er "\([^\)]+\) ?k[cmz]alloc ?\(" *
echo -e "\n===== Discouraged kcalloc(1,...) calls ...\n"
grep -Er "kcalloc ?\(1," *
echo -e "\n===== Where ARRAY_SIZE() should be used ...\n"
grep -Er "sizeof\((.*)\) ?/ ?sizeof\(\1\[0\]\)" *
echo -e "\n===== Where FIELD_SIZEOF() should be used ...\n"
grep -Er "sizeof ?\( ?\( ?\([^\*]*[^ ] ?\*\) ?0 ?\)->[^\)]+\)" *
echo -e "\n===== People who seem to be redefining MAX() or MIN() ...\n"
grep -Er "# +define +MAX ?\(" *
grep -Er "# +define +MIN ?\(" *
echo -e "\nDone."
next reply other threads:[~2006-12-19 15:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-19 15:46 Robert P. J. Day [this message]
2006-12-19 16:41 ` Dave Jones
2006-12-19 17:42 ` Bob Copeland
2006-12-19 20:27 ` Jan Engelhardt
2006-12-19 21:24 ` David Rientjes
2006-12-19 22:01 ` Jan Engelhardt
2006-12-19 23:09 ` David Rientjes
2006-12-20 22:42 ` Bill Davidsen
2006-12-21 20:52 ` Jan Engelhardt
[not found] ` <1166741599.27218.7.camel@localhost>
2006-12-21 23:29 ` Jan Engelhardt
[not found] ` <1166744416.14803.1.camel@localhost>
2006-12-21 23:56 ` Jan Engelhardt
2006-12-22 0:57 ` David Rientjes
2007-01-02 1:21 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0612191044170.7588@localhost.localdomain \
--to=rpjday@mindspring.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®