From: Takashi Iwai Subject: Re: [PATCH] asihpi update Date: Fri, 18 Nov 2005 12:20:06 +0100 Message-ID: References: <437D1FAE.3000400@audioscience.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <437D1FAE.3000400@audioscience.com> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Delio Brignoli Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Fri, 18 Nov 2005 13:26:22 +1300, Delio Brignoli wrote: > > Hello Takashi, > > this patch brings asihpi directory in alsa up to date with our internal > CVS repo. To be able to maintain ALSA reasonably up to date I've written > a preprocessor to strip most of the OS related code and generate asihpi > files automatically from a CVS workdir. Well, I don't this it's good to go to this way. We have imported the stuff to CVS. These codes have to be updated appropriately, too, not generated at compile time. > The code isn't as clean as the version you processed manually but I'm > happy to clean it further as long as I can automatically generate the > set of files. It would be great if you could apply the patch and send me > a list of must-change things. > > my todo list for now is: > > - automatically remove "HUGE". > - rearrange HPI_OS_ #ifs to help the preprocessor strip > more linux unrelated code. Please consider the following, too: - Replacement of HW8/HW16/HW32 with u8/u16/u32 types. Replacement of PLONG, etc, too. - Don't set EXTRA_CFLAGS. They can be either in a local header for static definitions, or derived from Kconfig (CONFIG_XXX). - No static hotplug directory in the kernel code. - Proper indentation and spaces. The indent is 8-chars in K&R style. Fold too long lines in 80 chars. See $KERNEL/Documentation/CodingStyle for details. If processing using a script, you can use "indent" program, too. > diff -aurw asihpi-bak/asihpi.c asihpi/asihpi.c > --- asihpi-bak/asihpi.c 2005-10-10 23:47:13.000000000 +1300 > +++ asihpi/asihpi.c 2005-11-18 13:18:32.000000000 +1300 > @@ -2186,7 +2186,7 @@ > > wVersion = asihpi->wVersion; > snd_iprintf(buffer, > - "Serial#=%d\nHw Version %c%d\nDSP code version %03d\n", > + "Serial#=%ld\nHw Version %c%d\nDSP code version %03d\n", > asihpi->dwSerialNumber, ((wVersion >> 3) & 0xf) + 'A', > wVersion & 0x7, > ((wVersion >> 13) * 100) + ((wVersion >> 7) & 0x3f)); This change looks wrong. dwSerialNumber is HW32, so it's fine with %d. %ld is for long type. > @@ -2200,7 +2200,7 @@ > err += HPI_SampleClock_GetSource(phSubSys, hControl, &wSource); > > if (!err) > - snd_iprintf(buffer, "SampleClock=%dHz, source %s\n", dwRate, > + snd_iprintf(buffer, "SampleClock=%ldHz, source %s\n", dwRate, > sampleclock_sources[wSource]); > } > Ditto. > @@ -2288,7 +2288,7 @@ > &asihpi->dwSerialNumber, &asihpi->wType); > HPI_HandleError(err); > wVersion = asihpi->wVersion; > - snd_printk(KERN_INFO "Adapter ID=%4X Index=%d NumOutStreams=%d NumInStreams=%d S/N=%d\n" "Hw Version %c%d DSP code version %03d\n", asihpi->wType, asihpi->wAdapterIndex, asihpi->wNumOutStreams, asihpi->wNumInStreams, asihpi->dwSerialNumber, ((wVersion >> 3) & 0xf) + 'A', // Hw version major > + snd_printk(KERN_INFO "Adapter ID=%4X Index=%d NumOutStreams=%d NumInStreams=%d S/N=%ld\n" "Hw Version %c%d DSP code version %03d\n", asihpi->wType, asihpi->wAdapterIndex, asihpi->wNumOutStreams, asihpi->wNumInStreams, asihpi->dwSerialNumber, ((wVersion >> 3) & 0xf) + 'A', // Hw version major > wVersion & 0x7, // Hw version minor > ((wVersion >> 13) * 100) + ((wVersion >> 7) & 0x3f) // DSP code version > ); Ditto. > diff -aurw asihpi-bak/boot4ka.h asihpi/boot4ka.h > --- asihpi-bak/boot4ka.h 2005-08-26 05:51:34.000000000 +1200 > +++ asihpi/boot4ka.h 2005-11-18 13:18:32.000000000 +1300 > @@ -20,33 +20,33 @@ > ******************************************************************************/ > // The following code came from boot4000.s.CLD > > -#include "hpios.h" // for defn. > +#include // for HFAR defn. We shouldn't use <> for local headers. > -static u32 adwDspCode_Boot4000a[] = > +static unsigned long HFAR adwDspCode_Boot4000a[] = u32 is not unsigned long. long can (but not always) be 64 bit. > -// static HW32 * adwDspCode_Boot4000Arrays[]={&adwDspCode_Boot4000a[0]}; > +// static HW32 HFAR * adwDspCode_Boot4000Arrays[]={&adwDspCode_Boot4000a[0]}; Yeah, HFAR and HUGE are evil... Thanks, Takashi ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click