From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Manish Katiyar <mkatiyar@gmail.com>
Cc: mingo@elte.hu, LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] Remove errors caught by checkpatch.pl in kernel/acct.c
Date: Mon, 16 Feb 2009 14:19:58 +0100 [thread overview]
Message-ID: <499967FE.1090903@s5r6.in-berlin.de> (raw)
In-Reply-To: <ea11fea30902151050i4b5b2e6esa0c4be519afa4127@mail.gmail.com>
Manish Katiyar wrote:
> Below patch removes errors generated by checkpatch.pl in
> kernel/acct.c. Caught by Ingo's code-quality script.
Bad changelog: Just say that this is a whitespace adjustment.
> @@ -416,7 +416,7 @@ static comp_t encode_comp_t(unsigned long value)
> #define MANTSIZE2 20 /* 20 bit mantissa. */
> #define EXPSIZE2 5 /* 5 bit base 2 exponent. */
> #define MAXFRACT2 ((1ul << MANTSIZE2) - 1) /* Maximum
> fractional value. */
Your MUA inserted line wraps where there should none. This won't apply
as a patch anymore.
> @@ -513,13 +514,13 @@ static void do_acct_process(struct bsd_acct_struct *acct,
> + current->group_leader->start_time.tv_nsec;
> /* convert nsec -> AHZ */
> elapsed = nsec_to_AHZ(run_time);
> -#if ACCT_VERSION==3
> +#if ACCT_VERSION == 3
> ac.ac_etime = encode_float(elapsed);
> #else
> ac.ac_etime = encode_comp_t(elapsed < (unsigned long) -1l ?
> - (unsigned long) elapsed : (unsigned long) -1l);
> + (unsigned long) elapsed:(unsigned long) -1l);
Should IMO be (unsigned long)elapsed : (unsigned long)-1l);
or simply stay as it was.
But more importantly, the whole expression looks bogus to me. elapsed
is an u64 and thus clearly defined regarding its size, while unsigned
long will have different sizes on different CPU architectures.
Is this intentional?
--
Stefan Richter
-=====-==--= --=- =----
http://arcgraph.de/sr/
prev parent reply other threads:[~2009-02-16 13:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-15 18:50 Manish Katiyar
2009-02-16 13:19 ` Stefan Richter [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=499967FE.1090903@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mkatiyar@gmail.com \
/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®