From: ben-linux@fluff.org (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: Use of data types
Date: Wed, 20 Jan 2010 05:25:53 +0000 [thread overview]
Message-ID: <20100120052552.GF26562@trinity.fluff.org> (raw)
In-Reply-To: <2703439e1001190357r65a507d2v668bbfca1a07c176@mail.gmail.com>
On Tue, Jan 19, 2010 at 08:57:03PM +0900, Khushhua Mogambo wrote:
> On Mon, Jan 18, 2010 at 10:58 PM, Sergei Shtylyov
> <sshtylyov@ru.mvista.com> wrote:
> > Hello.
> >
> > Matthias Kaehlcke wrote:
> >
> >>>> Hi
> >>>> ?I starting to port Linux kernel to my companies new ARM based
> >>>> SoC and development board.
> >>>>
> >>>> Some of the regs is 16bits wide and some is 32bits width. I ask if
> >>>> my using u16 and u32 in place of 'unsigned short' and 'unsigned int'
> >>>> in the whole porting would be acceptable or not?
> >>>>
> >>>> In different wording, using only u16 and u32 always is considered good
> >>>> quality or bad?
> >>>>
> >>>
> >>> I prefer using u32 over int. ?Still more if your register space isn't
> >>> uniform.
> >>>
> >>
> >> ditto
> >>
> >> how about using the C99 types uint32_t, ... in the kernel?
> >
> > ?They are actually used in some places but this is generally frowned upon.
> > They are for userspace.
> >
> > WBR, Sergei
>
> from thread, i understand that u32 is encouraged whenever we have reason. I m
> going to use u8,16,32 heavily.
It can depend on where it is being used, passing u8 and u16 around from
function to function can cost as the compiler tends to output code
to restrict the range of the registers' contents, thus u32 can end up
being a better choice.
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
next prev parent reply other threads:[~2010-01-20 5:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-18 12:43 Use of data types Khushhua Mogambo
2010-01-18 13:41 ` Uwe Kleine-König
2010-01-18 13:42 ` Matthias Kaehlcke
2010-01-18 13:52 ` Russell King - ARM Linux
[not found] ` <4B546900.3020506@ru.mvista.com>
2010-01-19 11:57 ` Khushhua Mogambo
2010-01-19 17:42 ` Russell King - ARM Linux
2010-01-20 12:15 ` Khushhua Mogambo
2010-01-20 5:25 ` Ben Dooks [this message]
2010-01-18 13:48 ` Russell King - ARM Linux
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=20100120052552.GF26562@trinity.fluff.org \
--to=ben-linux@fluff.org \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).