Skip to contentSkip to conversation

sound/pci: coding style fixes: emu10k1

PATCH In review Alexander Beregalov 1 participant 1 message Sep 9, 2008 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 8/24 sound/pci: coding style fixes: emu10k1

- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments

Only compile tested.

---

 sound/pci/emu10k1/emu10k1.c          |    8 +-
 sound/pci/emu10k1/emu10k1_callback.c |   28 ++--
 sound/pci/emu10k1/emu10k1_main.c     |  266 +++++++++++++++++-----------------
 sound/pci/emu10k1/emu10k1_patch.c    |   14 +-
 sound/pci/emu10k1/emu10k1_synth.c    |    2 +-
 sound/pci/emu10k1/emu10k1x.c         |  156 ++++++++++----------
 sound/pci/emu10k1/emufx.c            |  148 ++++++++++----------
 sound/pci/emu10k1/emumixer.c         |  130 ++++++++--------
 sound/pci/emu10k1/emumpu401.c        |    2 +-
 sound/pci/emu10k1/emupcm.c           |   56 ++++----
 sound/pci/emu10k1/emuproc.c          |   80 +++++-----
 sound/pci/emu10k1/io.c               |   32 ++--
 sound/pci/emu10k1/irq.c              |   18 +-
 sound/pci/emu10k1/memory.c           |    8 +-
 sound/pci/emu10k1/p16v.c             |  132 +++++++++---------
 sound/pci/emu10k1/p16v.h             |   14 +-
 sound/pci/emu10k1/p17v.h             |    6 +-
 sound/pci/emu10k1/voice.c            |   32 ++--
 18 files changed, 566 insertions(+), 566 deletions(-)
sound/pci/emu10k1/emu10k1.c +4 -4
index 8354c1a..094a874 100644
@@ -20,7 +20,7 @@
  *   along with this program; if not, write to the Free Software
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  *
- * 
+ *
  */
 
 #include <linux/init.h>
@@ -134,7 +134,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
 	if ((err = snd_emu10k1_pcm_efx(emu, 2, NULL)) < 0)
 		goto error;
 	/* This stores the periods table. */
-	if (emu->card_capabilities->ca0151_chip) { /* P16V */	
+	if (emu->card_capabilities->ca0151_chip) { /* P16V */
 		if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
 					       1024, &emu->p16v_buffer)) < 0)
 			goto error;
@@ -142,7 +142,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
 
 	if ((err = snd_emu10k1_mixer(emu, 0, 3)) < 0)
 		goto error;
-	
+
 	if ((err = snd_emu10k1_timer(emu, 0)) < 0)
 		goto error;
 
@@ -176,7 +176,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
 		arg->max_voices = max_synth_voices[dev];
 	}
 #endif
- 
+
 	strcpy(card->driver, emu->card_capabilities->driver);
 	strcpy(card->shortname, emu->card_capabilities->name);
 	snprintf(card->longname, sizeof(card->longname),
sound/pci/emu10k1/emu10k1_callback.c +14 -14
index 0e649dc..7bc7fce 100644
@@ -103,7 +103,7 @@ snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw)
 			int ch;
 			vp = &emu->voices[best[i].voice];
 			if ((ch = vp->ch) < 0) {
-				//printk("synth_get_voice: ch < 0 (%d) ??", i);
+				/* printk("synth_get_voice: ch < 0 (%d) ??", i); */
 				continue;
 			}
 			vp->emu->num_voices--;
@@ -128,7 +128,7 @@ release_voice(struct snd_emux_voice *vp)
 {
 	int dcysusv;
 	struct snd_emu10k1 *hw;
-	
+
 	hw = vp->hw;
 	dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease;
 	snd_emu10k1_ptr_write(hw, DCYSUSM, vp->ch, dcysusv);
@@ -144,7 +144,7 @@ static void
 terminate_voice(struct snd_emux_voice *vp)
 {
 	struct snd_emu10k1 *hw;
-	
+
 	if (snd_BUG_ON(!vp))
 		return;
 	hw = vp->hw;
@@ -164,7 +164,7 @@ static void
 free_voice(struct snd_emux_voice *vp)
 {
 	struct snd_emu10k1 *hw;
-	
+
 	hw = vp->hw;
 	/* FIXME: emu10k1_synth is broken. */
 	/* This can get called with hw == 0 */
@@ -173,7 +173,7 @@ free_voice(struct snd_emux_voice *vp)
 	if (hw && (vp->ch >= 0)) {
 		snd_emu10k1_ptr_write(hw, IFATN, vp->ch, 0xff00);
 		snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK);
-		// snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0);
+		/* snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0); */
 		snd_emu10k1_ptr_write(hw, VTFT, vp->ch, 0xffff);
 		snd_emu10k1_ptr_write(hw, CVCF, vp->ch, 0xffff);
 		snd_emu10k1_voice_free(hw, &hw->voices[vp->ch]);
@@ -190,7 +190,7 @@ static void
 update_voice(struct snd_emux_voice *vp, int update)
 {
 	struct snd_emu10k1 *hw;
-	
+
 	hw = vp->hw;
 	if (update & SNDRV_EMUX_UPDATE_VOLUME)
 		snd_emu10k1_ptr_write(hw, IFATN_ATTENUATION, vp->ch, vp->avol);
@@ -250,7 +250,7 @@ lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw,
 			bp = best + V_RELEASED;
 #if 1
 			val = snd_emu10k1_ptr_read(hw, CVCF_CURRENTVOL, vp->ch);
-			if (! val)
+			if (!val)
 				bp = best + V_OFF;
 #endif
 		}
@@ -323,7 +323,7 @@ start_voice(struct snd_emux_voice *vp)
 	struct snd_midi_channel *chan;
 	struct snd_emu10k1 *hw;
 	struct snd_emu10k1_memblk *emem;
-	
+
 	hw = vp->hw;
 	ch = vp->ch;
 	if (snd_BUG_ON(ch < 0))
@@ -335,7 +335,7 @@ start_voice(struct snd_emux_voice *vp)
 		return -EINVAL;
 	emem->map_locked++;
 	if (snd_emu10k1_memblk_map(hw, emem) < 0) {
-		// printk("emu: cannot map!\n");
+		/* printk("emu: cannot map!\n"); */
 		return -ENOMEM;
 	}
 	mapped_offset = snd_emu10k1_memblk_offset(emem) >> 1;
@@ -347,11 +347,11 @@ start_voice(struct snd_emux_voice *vp)
 	/* set channel routing */
 	/* A = left(0), B = right(1), C = reverb(c), D = chorus(d) */
 	if (hw->audigy) {
-		temp = FXBUS_MIDI_LEFT | (FXBUS_MIDI_RIGHT << 8) | 
+		temp = FXBUS_MIDI_LEFT | (FXBUS_MIDI_RIGHT << 8) |
 			(FXBUS_MIDI_REVERB << 16) | (FXBUS_MIDI_CHORUS << 24);
 		snd_emu10k1_ptr_write(hw, A_FXRT1, ch, temp);
 	} else {
-		temp = (FXBUS_MIDI_LEFT << 16) | (FXBUS_MIDI_RIGHT << 20) | 
+		temp = (FXBUS_MIDI_LEFT << 16) | (FXBUS_MIDI_RIGHT << 20) |
 			(FXBUS_MIDI_REVERB << 24) | (FXBUS_MIDI_CHORUS << 28);
 		snd_emu10k1_ptr_write(hw, FXRT, ch, temp);
 	}
@@ -437,7 +437,7 @@ start_voice(struct snd_emux_voice *vp)
 		temp = ((unsigned int)hw->silent_page.addr << 1) | MAP_PTI_MASK;
 		snd_emu10k1_ptr_write(hw, MAPA, ch, temp);
 		snd_emu10k1_ptr_write(hw, MAPB, ch, temp);
-		
+
 		/* fill cache */
 		val -= 4;
 		val <<= 25;
@@ -476,11 +476,11 @@ trigger_voice(struct snd_emux_voice *vp)
 	unsigned int temp, ptarget;
 	struct snd_emu10k1 *hw;
 	struct snd_emu10k1_memblk *emem;
-	
+
 	hw = vp->hw;
 
 	emem = (struct snd_emu10k1_memblk *)vp->block;
-	if (! emem || emem->mapped_page < 0)
+	if (!emem || emem->mapped_page < 0)
 		return; /* not mapped */
 
 #if 0
sound/pci/emu10k1/emu10k1_main.c +133 -133

751 lines not on this page · raw message

sound/pci/emu10k1/emu10k1_patch.c +7 -7
index e10f027..8e59bba 100644
@@ -88,7 +88,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
 
 	/* try to allocate a memory block */
 	blocksize = truesize;
-	if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+	if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
 		blocksize *= 2;
 	sp->block = snd_emu10k1_synth_alloc(emu, blocksize);
 	if (sp->block == NULL) {
@@ -102,7 +102,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
 	/* write blank samples at head */
 	offset = 0;
 	size = BLANK_HEAD_SIZE;
-	if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+	if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
 		size *= 2;
 	if (offset + size > blocksize)
 		return -EINVAL;
@@ -111,7 +111,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
 
 	/* copy start->loopend */
 	size = loopend;
-	if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+	if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
 		size *= 2;
 	if (offset + size > blocksize)
 		return -EINVAL;
@@ -127,7 +127,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
 	/* handle reverse (or bidirectional) loop */
 	if (sp->v.mode_flags & (SNDRV_SFNT_SAMPLE_BIDIR_LOOP|SNDRV_SFNT_SAMPLE_REVERSE_LOOP)) {
 		/* copy loop in reverse */
-		if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS)) {
+		if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS)) {
 			int woffset;
 			unsigned short *wblock = (unsigned short*)block;
 			woffset = offset / 2;
@@ -160,7 +160,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
 	size = sp->v.size - loopend;
 	if (size < 0)
 		return -EINVAL;
-	if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+	if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
 		size *= 2;
 	if (snd_emu10k1_synth_copy_from_user(emu, sp->block, offset, data, size)) {
 		snd_emu10k1_synth_free(emu, sp->block);
@@ -184,7 +184,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
 #if 0 /* not supported yet */
 	if (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_UNSIGNED) {
 		/* unsigned -> signed */
-		if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS)) {
+		if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS)) {
 			unsigned short *wblock = (unsigned short*)block;
 			for (i = 0; i < truesize; i++)
 				wblock[i] ^= 0x8000;
@@ -197,7 +197,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
 
 	/* recalculate offset */
 	start_addr = BLANK_HEAD_SIZE * 2;
-	if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+	if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
 		start_addr >>= 1;
 	sp->v.start += start_addr;
 	sp->v.end += start_addr;
sound/pci/emu10k1/emu10k1_synth.c +1 -1
index ad7b714..bedb7dd 100644
@@ -105,7 +105,7 @@ static int snd_emu10k1_synth_delete_device(struct snd_seq_device *dev)
 
 static int __init alsa_emu10k1_synth_init(void)
 {
-	
+
 	static struct snd_seq_dev_ops ops = {
 		snd_emu10k1_synth_new_device,
 		snd_emu10k1_synth_delete_device,
sound/pci/emu10k1/emu10k1x.c +78 -78

480 lines not on this page · raw message

sound/pci/emu10k1/emufx.c +74 -74

541 lines not on this page · raw message

sound/pci/emu10k1/emumixer.c +65 -65

351 lines not on this page · raw message

sound/pci/emu10k1/emumpu401.c +1 -1
index 8578c70..18495b4 100644
@@ -277,7 +277,7 @@ static void snd_emu10k1_midi_output_trigger(struct snd_rawmidi_substream *substr
 	if (up) {
 		int max = 4;
 		unsigned char byte;
-	
+
 		/* try to send some amount of bytes here before interrupts */
 		spin_lock_irqsave(&midi->output_lock, flags);
 		while (max > 0) {
sound/pci/emu10k1/emupcm.c +28 -28

201 lines not on this page · raw message

sound/pci/emu10k1/emuproc.c +40 -40

267 lines not on this page · raw message

sound/pci/emu10k1/io.c +16 -16
index b5a802b..c77f5f2 100644
@@ -42,16 +42,16 @@ unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, un
 
 	if (reg & 0xff000000) {
 		unsigned char size, offset;
-		
+
 		size = (reg >> 24) & 0x3f;
 		offset = (reg >> 16) & 0x1f;
 		mask = ((1 << size) - 1) << offset;
-		
+
 		spin_lock_irqsave(&emu->emu_lock, flags);
 		outl(regptr, emu->port + PTR);
 		val = inl(emu->port + DATA);
 		spin_unlock_irqrestore(&emu->emu_lock, flags);
-		
+
 		return (val & mask) >> offset;
 	} else {
 		spin_lock_irqsave(&emu->emu_lock, flags);
@@ -90,7 +90,7 @@ void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned i
 		outl(regptr, emu->port + PTR);
 		data |= inl(emu->port + DATA) & ~mask;
 		outl(data, emu->port + DATA);
-		spin_unlock_irqrestore(&emu->emu_lock, flags);		
+		spin_unlock_irqrestore(&emu->emu_lock, flags);
 	} else {
 		spin_lock_irqsave(&emu->emu_lock, flags);
 		outl(regptr, emu->port + PTR);
@@ -101,13 +101,13 @@ void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned i
 
 EXPORT_SYMBOL(snd_emu10k1_ptr_write);
 
-unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, 
-					  unsigned int reg, 
+unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu,
+					  unsigned int reg,
 					  unsigned int chn)
 {
 	unsigned long flags;
 	unsigned int regptr, val;
-  
+
 	regptr = (reg << 16) | chn;
 
 	spin_lock_irqsave(&emu->emu_lock, flags);
@@ -117,9 +117,9 @@ unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu,
 	return val;
 }
 
-void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, 
-				   unsigned int reg, 
-				   unsigned int chn, 
+void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu,
+				   unsigned int reg,
+				   unsigned int chn,
 				   unsigned int data)
 {
 	unsigned int regptr;
@@ -230,7 +230,7 @@ int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu,
 				break;
 			}
 		}
-		//Read back and see if the transaction is successful
+		/* Read back and see if the transaction is successful */
 		if ((status & I2C_A_ADC_ABORT) == 0)
 			break;
 	}
@@ -242,7 +242,7 @@ int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu,
 		/* dump_stack(); */
 		err = -EINVAL;
 	}
-    
+
 	spin_unlock(&emu->i2c_lock);
 	return err;
 }
@@ -291,10 +291,10 @@ int snd_emu1010_fpga_read(struct snd_emu10k1 * emu, u32 reg, u32 *value)
  */
 int snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 * emu, u32 dst, u32 src)
 {
-	snd_emu1010_fpga_write(emu, 0x00, ((dst >> 8) & 0x3f) );
-	snd_emu1010_fpga_write(emu, 0x01, (dst & 0x3f) );
-	snd_emu1010_fpga_write(emu, 0x02, ((src >> 8) & 0x3f) );
-	snd_emu1010_fpga_write(emu, 0x03, (src & 0x3f) );
+	snd_emu1010_fpga_write(emu, 0x00, ((dst >> 8) & 0x3f));
+	snd_emu1010_fpga_write(emu, 0x01, (dst & 0x3f));
+	snd_emu1010_fpga_write(emu, 0x02, ((src >> 8) & 0x3f));
+	snd_emu1010_fpga_write(emu, 0x03, (src & 0x3f));
 
 	return 0;
 }
sound/pci/emu10k1/irq.c +9 -9
index 30bfed6..e4947a6 100644
@@ -157,19 +157,19 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id)
 				struct snd_emu10k1_voice *pvoice = &(emu->p16v_voices[0]);
 				struct snd_emu10k1_voice *cvoice = &(emu->p16v_capture_voice);
 
-				//printk(KERN_INFO "status2=0x%x\n", status2);
+				/* printk(KERN_INFO "status2=0x%x\n", status2); */
 				orig_status2 = status2;
-				if(status2 & mask) {
-					if(pvoice->use) {
+				if (status2 & mask) {
+					if (pvoice->use) {
 						snd_pcm_period_elapsed(pvoice->epcm->substream);
-					} else { 
+					} else {
 						snd_printk(KERN_ERR "p16v: status: 0x%08x, mask=0x%08x, pvoice=%p, use=%d\n", status2, mask, pvoice, pvoice->use);
 					}
 				}
-				if(status2 & 0x110000) {
-					//printk(KERN_INFO "capture int found\n");
-					if(cvoice->use) {
-						//printk(KERN_INFO "capture period_elapsed\n");
+				if (status2 & 0x110000) {
+					/* printk(KERN_INFO "capture int found\n"); */
+					if (cvoice->use) {
+						/* printk(KERN_INFO "capture period_elapsed\n"); */
 						snd_pcm_period_elapsed(cvoice->epcm->substream);
 					}
 				}
@@ -181,7 +181,7 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id)
 		if (status) {
 			unsigned int bits;
 			snd_printk(KERN_ERR "emu10k1: unhandled interrupt: 0x%08x\n", status);
-			//make sure any interrupts we don't handle are disabled:
+			/* make sure any interrupts we don't handle are disabled: */
 			bits = INTE_FXDSPENABLE |
 				INTE_PCIERRORENABLE |
 				INTE_VOLINCRENABLE |
sound/pci/emu10k1/memory.c +4 -4
index 6a47672..e6067f6 100644
@@ -323,7 +323,7 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst
 		unsigned long ofs = idx << PAGE_SHIFT;
 		dma_addr_t addr;
 		addr = snd_pcm_sgbuf_get_addr(substream, ofs);
-		if (! is_valid_page(emu, addr)) {
+		if (!is_valid_page(emu, addr)) {
 			printk(KERN_ERR "emu: failure page = %d\n", idx);
 			mutex_unlock(&hdr->block_mutex);
 			return NULL;
@@ -368,7 +368,7 @@ struct snd_util_memblk *
 snd_emu10k1_synth_alloc(struct snd_emu10k1 *hw, unsigned int size)
 {
 	struct snd_emu10k1_memblk *blk;
-	struct snd_util_memhdr *hdr = hw->memhdr; 
+	struct snd_util_memhdr *hdr = hw->memhdr;
 
 	mutex_lock(&hdr->block_mutex);
 	blk = (struct snd_emu10k1_memblk *)__snd_util_mem_alloc(hdr, size);
@@ -394,7 +394,7 @@ EXPORT_SYMBOL(snd_emu10k1_synth_alloc);
 int
 snd_emu10k1_synth_free(struct snd_emu10k1 *emu, struct snd_util_memblk *memblk)
 {
-	struct snd_util_memhdr *hdr = emu->memhdr; 
+	struct snd_util_memhdr *hdr = emu->memhdr;
 	struct snd_emu10k1_memblk *blk = (struct snd_emu10k1_memblk *)memblk;
 	unsigned long flags;
 
@@ -499,7 +499,7 @@ static inline void *offset_ptr(struct snd_emu10k1 *emu, int page, int offset)
 	if (snd_BUG_ON(page < 0 || page >= emu->max_cache_pages))
 		return NULL;
 	ptr = emu->page_ptr_table[page];
-	if (! ptr) {
+	if (!ptr) {
 		printk(KERN_ERR "emu10k1: access to NULL ptr: page = %d\n", page);
 		return NULL;
 	}
sound/pci/emu10k1/p16v.c +66 -66

47 lines not on this page · raw message

sound/pci/emu10k1/p16v.h +7 -7
index 1532149..7964c8e 100644

Lines of this file are not shown. View the raw message.

sound/pci/emu10k1/p17v.h +3 -3
index 4ef5f68..0a28974 100644

Lines of this file are not shown. View the raw message.

sound/pci/emu10k1/voice.c +16 -16
index d7300a1..de271d0 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.