From: Chris Wright <chrisw@osdl.org>
To: Jonathan Ho <jonathanho15@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] string lib redundancy and whitespace clarity fixes
Date: Wed, 9 Feb 2005 16:46:01 -0800 [thread overview]
Message-ID: <20050209164601.K469@build.pdx.osdl.net> (raw)
In-Reply-To: <420AAB9D.6010801@gmail.com>; from jonathanho15@gmail.com on Wed, Feb 09, 2005 at 04:32:29PM -0800
* Jonathan Ho (jonathanho15@gmail.com) wrote:
> Fixed some weird whitespace, solved redundancies (applies to v2.6.10).
>
> Signed-off-by: Jonathan Ho <jonathanho15@gmail.com>
>
> --- lib/string.c Fri Dec 24 13:35:25 2004
> +++ \documents and settings\jonathan\desktop/string.c Wed Feb 09
This won't apply nicely with -p1. Nor will it apply against
current -bk (which no longer has bcopy in it, for example).
> 16:21:28 2005
> @@ -38,7 +38,7 @@ int strnicmp(const char *s1, const char
> /* Yes, Virginia, it had better be unsigned */
> unsigned char c1, c2;
>
> - c1 = 0; c2 = 0;
> + c1 = c2 = 0;
> if (len) {
> do {
> c1 = *s1; c2 = *s2;
> @@ -253,12 +253,12 @@ EXPORT_SYMBOL(strncmp);
> * @s: The string to be searched
> * @c: The character to search for
> */
> -char * strchr(const char * s, int c)
> +char *strchr(const char * s, int c)
> {
> - for(; *s != (char) c; ++s)
> + for( ; *s != (char) c; s++)
> if (*s == '\0')
> return NULL;
> - return (char *) s;
> + return (char *)s;
For this kind of CodingStyle cleanup, I think it's probably not worth it.
Unless you have other changes and fixes planned in the area.
> }
> EXPORT_SYMBOL(strchr);
> #endif
> @@ -390,14 +390,14 @@ EXPORT_SYMBOL(strcspn);
> * @cs: The string to be searched
> * @ct: The characters to search for
> */
> -char * strpbrk(const char * cs,const char * ct)
> +char * strpbrk(const char *cs, const char *ct)
> {
> - const char *sc1,*sc2;
> + const char *sc1, *sc2;
>
> - for( sc1 = cs; *sc1 != '\0'; ++sc1) {
> - for( sc2 = ct; *sc2 != '\0'; ++sc2) {
> + for(sc1 = cs; *sc1 != '\0'; sc1++) {
> + for(sc2 = ct; *sc2 != '\0'; sc2++) {
Neither of these is CodingStyle compliant ;-) Take a look at what
Lindent does (not perfect, but good rule of thumb).
thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
prev parent reply other threads:[~2005-02-10 0:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-10 0:32 Jonathan Ho
2005-02-10 0:46 ` Chris Wright [this message]
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=20050209164601.K469@build.pdx.osdl.net \
--to=chrisw@osdl.org \
--cc=jonathanho15@gmail.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®