From: Pavel Machek <pavel@ucw.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Joe Perches <joe@perches.com>, Andy Whitcroft <apw@canonical.com>,
Adil Mujeeb <mujeeb.adil@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] checkpatch: Emit a warning when decimal values are used
Date: Thu, 1 Nov 2012 10:22:05 +0100 [thread overview]
Message-ID: <20121101092204.GA11188@elf.ucw.cz> (raw)
In-Reply-To: <20121031154908.5a1921eb.akpm@linux-foundation.org>
Hi!
> > > Linux kernel doesn't like decimals, say so.
> >
> > ?!
> >
> > Linux surely supports decimal constants, like "100". Did you mean
> > "octal"?
> >
> > If you wanted to add warning for something... I never want to see
> >
> > #define CRAPPY_EMBEDDED_REGISTER ((0x1) << (0))
> >
> > again....
>
> Joe means floating point. I suggest that the patchset be reworked,
> using s/decimal/float/g.
>
>
> The kernel does have floating point constants, in various graphics
> drivers, iirc. They are used in places where the floatiness gets
> handled at complation time. Along the lines of:
>
> int foo = 1.1 * 2.2;
....
> A much better solution would be to arrange for the kernel to fail to
> compile (or to fail to link) if floats are used. That way, people
> could continue to use floats within their compile-time scalar
> expressions without getting harrassed by checkpatch. But I don't know
> how to arrange this.
I know it is normally unwanted, but we do have kernel_fpu_begin(). I
thought it enables exactly... floating point math in kernel?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2012-11-01 9:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-31 10:13 [PATCH 0/3] checkpatch: Add support for decimal values Joe Perches
2012-10-31 10:13 ` [PATCH 1/3] checkpatch: Find hex constants as a single IDENT Joe Perches
2012-10-31 10:13 ` [PATCH 2/3] checkpatch: Add support for decimal constants Joe Perches
2012-10-31 10:13 ` [PATCH 3/3] checkpatch: Emit a warning when decimal values are used Joe Perches
2012-10-31 10:37 ` Pavel Machek
2012-10-31 22:49 ` Andrew Morton
2012-11-01 9:22 ` Pavel Machek [this message]
2012-11-01 11:43 ` Borislav Petkov
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=20121101092204.GA11188@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mujeeb.adil@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
Powered by JetHome