* Use of data types in new portings
@ 2010-01-17 13:02 Khushhua Mogambo
2010-01-21 20:19 ` David Woodhouse
0 siblings, 1 reply; 2+ messages in thread
From: Khushhua Mogambo @ 2010-01-17 13:02 UTC (permalink / raw)
To: linux-arm-kernel
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?
many thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100117/c5c5b39c/attachment.htm>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Use of data types in new portings
2010-01-17 13:02 Use of data types in new portings Khushhua Mogambo
@ 2010-01-21 20:19 ` David Woodhouse
0 siblings, 0 replies; 2+ messages in thread
From: David Woodhouse @ 2010-01-21 20:19 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, 2010-01-17 at 22:02 +0900, Khushhua Mogambo wrote:
> 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?
Personally, I always prefer to avoid the the 'u16' and 'u32' nonsense
types in favour of the proper C types 'uint16_t' and 'uint32_t'.
There is a small amount of justification for the __u16 and __u32
variants, in headers which are exposed to userspace.... but only if you
believe that you really _have_ to avoid exposing the proper C types to
the users because everything will break if you include <stdint.h> for
them. Which is not really true.
If you have types which are explicitly sized and _must_ be 16-bit or
32-bit, then by all means use a sized type (u16 or preferably uint16_t).
Otherwise, stick with normal types.
--
dwmw2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-21 20:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-17 13:02 Use of data types in new portings Khushhua Mogambo
2010-01-21 20:19 ` David Woodhouse
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).