From: Takashi Iwai Subject: Re: [PATCH] Reduce interrupt latency in sound/pci/via82xx.c Date: Thu, 29 Sep 2005 12:44:59 +0200 Message-ID: References: <200509121418.05184.annabellesgarden@yahoo.de> <4325FA70.3090702@superbug.co.uk> <200509131318.25702.annabellesgarden@yahoo.de> <200509262052.38990.annabellesgarden@yahoo.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <200509262052.38990.annabellesgarden@yahoo.de> 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: Karsten Wiese Cc: James Courtier-Dutton , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At some time ago, Karsten Wiese wrote: > > > @@ -401,8 +406,8 @@ > }; > > static struct pci_device_id snd_via82xx_ids[] = { > - { 0x1106, 0x3058, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA686, }, /* 686A */ > - { 0x1106, 0x3059, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA8233, }, /* VT8233 */ > + { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA686, }, /* 686A */ > + { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA8233, }, /* VT8233 */ > { 0, } > }; I like to keep the numbers here to check the support PCI IDs easier from the driver code. I don't think changing this to PCI_* would improve the readability. The only drawback to use the numbers is possible typos, though. > /* > + * Interrupt handler > + */ > +static irqreturn_t snd_via8233_interrupt(int irq, void *dev_id, struct pt_regs *regs) > +{ > + via82xx_t *chip = dev_id; > + unsigned int status; > + unsigned int i; > + unsigned int intr_mask; > + irqreturn_t irqreturn = IRQ_NONE; > + > + > + /* check status for each stream */ > + intr_mask = chip->intr_mask; > + spin_lock(&chip->reg_lock); > + status = inl(VIAREG(chip, SGD_SHADOW)); > + for (i = 0; i < chip->num_devs; > + i++, intr_mask >>= 4, status >>= 4) { > + viadev_t *viadev = &chip->devs[i]; > + snd_pcm_substream_t *substream; > + unsigned char c_status; > + while (!(intr_mask & 3)) { > + intr_mask >>= 4; > + status >>= 4; > + } It'd be better to have a new field in viadev struct to indicate the shift bits rather than this loop. The loop looks ad-hoc. Also, could you use tabs instead of spaces, as mentioned in CodingStyle? Otherwise, it looks fine to me. Thanks! Takashi ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl