Re: [PATCH 2/2] sis7019: add support for pre-2.6 kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Mon, 10 Dec 2007 15:48:44 +0100,
Clemens Ladisch wrote:
> 
> Dave Dillow wrote:
> > On Mon, 2007-12-10 at 08:53 +0100, Clemens Ladisch wrote:
> > > Dave Dillow wrote:
> > > > The sis7019 driver uses __ffs(), which is available in 2.6 kernels, but
> > > > not in most earlier ones. This patches the driver to use a local version
> > > > assembly version, as the hardware is SiS 55x only (i486/Pentium-ish).
> > > > 
> > > > ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
> > > > ++static inline unsigned long sis_ffs(unsigned long word)
> > > > ++{
> > > > ++	__asm__("bsfl %1,%0"
> > > > ++		:"=r" (word)
> > > > ++		:"rm" (word));
> > > > ++	return word;
> > > > ++}
> > > > ++#endif
> > > 
> > > This should go into alsa-driver/include/adriver.h.
> > 
> > I'm not sure -- there's no other inline assembly there, and if I provide
> > an x86 _ffs() fallback, then it'll break on other architectures...
> 
> It won't break unless another driver actually uses __ffs(), and then we
> can still add a generic implementation.

Yep, it seems so.  The invalid asm codes becomes an error only at
assembler -> binary level, so it's harmless unless it's really used in
the driver code.

Anyway, uninitialized_var() should be ported to adriver.h as well.
Then we'll have a clean sis7019.c in alsa-driver tree, too.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux