/*
  * CA0132 chip DSP transfer stuffs.  For DSP download.
  */
-#define INVALID_DMA_CHANNEL (~0UL)
+#define INVALID_DMA_CHANNEL (~0U)
 
 /*
  * Program a list of address/data pairs via the ChipIO widget.
        dma_engine->buf_size = (ovly ? DSP_DMA_WRITE_BUFLEN_OVLY :
                        DSP_DMA_WRITE_BUFLEN_INIT) * 2;
 
-       dma_chan = 0;
+       dma_chan = ovly ? INVALID_DMA_CHANNEL : 0;
 
        status = codec_set_converter_format(codec, WIDGET_CHIP_CTRL,
                                        hda_format, &response);
                status = dspio_alloc_dma_chan(codec, &dma_chan);
                if (status < 0) {
                        snd_printdd(KERN_ERR "alloc dmachan fail");
-                       dma_chan = (unsigned int)INVALID_DMA_CHANNEL;
+                       dma_chan = INVALID_DMA_CHANNEL;
                        goto exit;
                }
        }