sound/sparc/dbri.c:1842:1-3: WARNING: possible condition with no effect (if == else)

kernel test robot <[email protected]> Fri, 31 Jul 2026 08:48:11 +0800
Newsgroups dev.linux.lists.oe-kbuild
Message-ID <[email protected]>
BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Takashi Iwai <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   11028ab62899e4191e074ee364c712b77823a9c4
commit: 3c30d57544bf91d6adaf3cab8474194e4c4404bc ALSA: sparc/dbri: Use guard() for spin locks
date:   11 months ago
:::::: branch date: 25 hours ago
:::::: commit date: 11 months ago
config: sparc-randconfig-r063-20260731 (https://download.01.org/0day-ci/archive/20260731/[email protected]/config)
compiler: sparc64-linux-gcc (GCC) 15.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Fixes: 3c30d57544bf ("ALSA: sparc/dbri: Use guard() for spin locks")
| Reported-by: kernel test robot <[email protected]>
| Reported-by: Julia Lawall <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

cocci warnings: (new ones prefixed by >>)
>> sound/sparc/dbri.c:1842:1-3: WARNING: possible condition with no effect (if == else)

vim +1842 sound/sparc/dbri.c

1bd9debf25b8a5 Takashi Iwai   2005-06-30  1841  
1bd9debf25b8a5 Takashi Iwai   2005-06-30 @1842  	if (channel == D_INTR_CMD) {
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1843  		dprintk(D_CMD, "INTR: Command: %-5s  Value:%d\n",
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1844  			cmds[command], val);
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1845  	} else {
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1846  		dprintk(D_INT, "INTR: Chan:%d Code:%d Val:%#x\n",
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1847  			channel, code, rval);
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1848  	}
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1849  
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1850  	switch (code) {
1be54c824be9b5 Krzysztof Helt 2006-08-21  1851  	case D_INTR_CMDI:
1be54c824be9b5 Krzysztof Helt 2006-08-21  1852  		if (command != D_WAIT)
1be54c824be9b5 Krzysztof Helt 2006-08-21  1853  			printk(KERN_ERR "DBRI: Command read interrupt\n");
1be54c824be9b5 Krzysztof Helt 2006-08-21  1854  		break;
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1855  	case D_INTR_BRDY:
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1856  		reception_complete_intr(dbri, channel);
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1857  		break;
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1858  	case D_INTR_XCMP:
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1859  	case D_INTR_MINT:
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1860  		transmission_complete_intr(dbri, channel);
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1861  		break;
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1862  	case D_INTR_UNDR:
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1863  		/* UNDR - Transmission underrun
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1864  		 * resend SDP command with clear pipe bit (C) set
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1865  		 */
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1866  		{
1be54c824be9b5 Krzysztof Helt 2006-08-21  1867  	/* FIXME: do something useful in case of underrun */
1be54c824be9b5 Krzysztof Helt 2006-08-21  1868  			printk(KERN_ERR "DBRI: Underrun error\n");
1be54c824be9b5 Krzysztof Helt 2006-08-21  1869  #if 0
1be54c824be9b5 Krzysztof Helt 2006-08-21  1870  			s32 *cmd;
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1871  			int pipe = channel;
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1872  			int td = dbri->pipes[pipe].desc;
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1873  
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1874  			dbri->dma->desc[td].word4 = 0;
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1875  			cmd = dbri_cmdlock(dbri, NoGetLock);
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1876  			*(cmd++) = DBRI_CMD(D_SDP, 0,
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1877  					    dbri->pipes[pipe].sdp
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1878  					    | D_SDP_P | D_SDP_C | D_SDP_2SAME);
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1879  			*(cmd++) = dbri->dma_dvma + dbri_dma_off(desc, td);
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1880  			dbri_cmdsend(dbri, cmd);
1be54c824be9b5 Krzysztof Helt 2006-08-21  1881  #endif
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1882  		}
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1883  		break;
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1884  	case D_INTR_FXDT:
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1885  		/* FXDT - Fixed data change */
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1886  		if (dbri->pipes[channel].sdp & D_SDP_MSB)
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1887  			val = reverse_bytes(val, dbri->pipes[channel].length);
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1888  
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1889  		if (dbri->pipes[channel].recv_fixed_ptr)
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1890  			*(dbri->pipes[channel].recv_fixed_ptr) = val;
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1891  		break;
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1892  	default:
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1893  		if (channel != D_INTR_CMD)
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1894  			printk(KERN_WARNING
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1895  			       "DBRI: Ignored Interrupt: %d (0x%x)\n", code, x);
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1896  	}
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1897  }
1bd9debf25b8a5 Takashi Iwai   2005-06-30  1898  

:::::: The code at line 1842 was first introduced by commit
:::::: 1bd9debf25b8a5f5029d7619f43e4a9a775973d3 [ALSA] Add DBRI driver on Sparcs

:::::: TO: Takashi Iwai <[email protected]>
:::::: CC: Jaroslav Kysela <[email protected]>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki