l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
April 21: Google Glass
Next Installfest:
TBD
Latest News:
Mar. 18: Google Glass at LUGOD's April meeting
Page last updated:
2002 Sep 12 22:12

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] appropriate variable size in driver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] appropriate variable size in driver



On Wed, 11 Sep 2002, Eric Nelson wrote:

> I am porting a driver from an 8 bit processer to a linux driver.  Many 
> counters and other variables are unsigned char, because they don't 
> get big, do it works, kind of the embedded thing to do - keep small.  
> The target is a 32 bit geode.  It seems like I should generalize 
> these variables to 16 bit or 32 bit.  What works better?  What is 
> more 'appropriate'.  It seems kind of old fashioned to leave them at 
> 8 bit.

Processing 8-bit integers tends to be slightly slower on 32-bit
processors, and in some architectures is considerably slower.  I would
widen them.

As to whether signed or unsigned is slower, that is architecturally
dependent too. AFAIK signed is slightly faster on x86, but Linux is
multiplatform so that is probably not a good justification for decisions.
I would use "int" unless I needed something more specific for a reason.

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k
---------------------------------------------------------------------------

_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!