lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <201908120721.RrTbsYsP%lkp@intel.com>
Date:   Mon, 12 Aug 2019 07:54:01 +0800
From:   kbuild test robot <lkp@...el.com>
To:     "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc:     kbuild-all@...org, linux-kernel@...r.kernel.org
Subject: drivers/dma/fsldma.c:1165:26: warning: this statement may fall
 through

tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d45331b00ddb179e291766617259261c112db872
commit: a035d552a93bb9ef6048733bb9f2a0dc857ff869 Makefile: Globally enable fall-through warning
date:   2 weeks ago
config: powerpc-ppa8548_defconfig (attached as .config)
compiler: powerpc-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout a035d552a93bb9ef6048733bb9f2a0dc857ff869
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   drivers/dma/fsldma.c: In function 'fsl_dma_chan_probe':
>> drivers/dma/fsldma.c:1165:26: warning: this statement may fall through [-Wimplicit-fallthrough=]
      chan->toggle_ext_pause = fsl_chan_toggle_ext_pause;
      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/dma/fsldma.c:1166:2: note: here
     case FSL_DMA_IP_83XX:
     ^~~~

vim +1165 drivers/dma/fsldma.c

a4f56d4b103d4e Ira Snyder               2010-01-06  1104  
463a1f8b3ceebe Bill Pemberton           2012-11-19  1105  static int fsl_dma_chan_probe(struct fsldma_device *fdev,
77cd62e8082b97 Timur Tabi               2008-09-26  1106  	struct device_node *node, u32 feature, const char *compatible)
173acc7ce8538f Zhang Wei                2008-03-01  1107  {
a1c03319018061 Ira Snyder               2010-01-06  1108  	struct fsldma_chan *chan;
4ce0e953f62867 Ira Snyder               2010-01-06  1109  	struct resource res;
173acc7ce8538f Zhang Wei                2008-03-01  1110  	int err;
173acc7ce8538f Zhang Wei                2008-03-01  1111  
173acc7ce8538f Zhang Wei                2008-03-01  1112  	/* alloc channel */
a1c03319018061 Ira Snyder               2010-01-06  1113  	chan = kzalloc(sizeof(*chan), GFP_KERNEL);
a1c03319018061 Ira Snyder               2010-01-06  1114  	if (!chan) {
e7a29151de1bd5 Ira Snyder               2010-01-06  1115  		err = -ENOMEM;
e7a29151de1bd5 Ira Snyder               2010-01-06  1116  		goto out_return;
e7a29151de1bd5 Ira Snyder               2010-01-06  1117  	}
e7a29151de1bd5 Ira Snyder               2010-01-06  1118  
e7a29151de1bd5 Ira Snyder               2010-01-06  1119  	/* ioremap registers for use */
a1c03319018061 Ira Snyder               2010-01-06  1120  	chan->regs = of_iomap(node, 0);
a1c03319018061 Ira Snyder               2010-01-06  1121  	if (!chan->regs) {
e7a29151de1bd5 Ira Snyder               2010-01-06  1122  		dev_err(fdev->dev, "unable to ioremap registers\n");
e7a29151de1bd5 Ira Snyder               2010-01-06  1123  		err = -ENOMEM;
a1c03319018061 Ira Snyder               2010-01-06  1124  		goto out_free_chan;
173acc7ce8538f Zhang Wei                2008-03-01  1125  	}
173acc7ce8538f Zhang Wei                2008-03-01  1126  
4ce0e953f62867 Ira Snyder               2010-01-06  1127  	err = of_address_to_resource(node, 0, &res);
173acc7ce8538f Zhang Wei                2008-03-01  1128  	if (err) {
e7a29151de1bd5 Ira Snyder               2010-01-06  1129  		dev_err(fdev->dev, "unable to find 'reg' property\n");
e7a29151de1bd5 Ira Snyder               2010-01-06  1130  		goto out_iounmap_regs;
173acc7ce8538f Zhang Wei                2008-03-01  1131  	}
173acc7ce8538f Zhang Wei                2008-03-01  1132  
a1c03319018061 Ira Snyder               2010-01-06  1133  	chan->feature = feature;
173acc7ce8538f Zhang Wei                2008-03-01  1134  	if (!fdev->feature)
a1c03319018061 Ira Snyder               2010-01-06  1135  		fdev->feature = chan->feature;
173acc7ce8538f Zhang Wei                2008-03-01  1136  
e7a29151de1bd5 Ira Snyder               2010-01-06  1137  	/*
e7a29151de1bd5 Ira Snyder               2010-01-06  1138  	 * If the DMA device's feature is different than the feature
e7a29151de1bd5 Ira Snyder               2010-01-06  1139  	 * of its channels, report the bug
173acc7ce8538f Zhang Wei                2008-03-01  1140  	 */
a1c03319018061 Ira Snyder               2010-01-06  1141  	WARN_ON(fdev->feature != chan->feature);
e7a29151de1bd5 Ira Snyder               2010-01-06  1142  
a1c03319018061 Ira Snyder               2010-01-06  1143  	chan->dev = fdev->dev;
8de7a7d95049bd Hongbo Zhang             2013-09-26  1144  	chan->id = (res.start & 0xfff) < 0x300 ?
8de7a7d95049bd Hongbo Zhang             2013-09-26  1145  		   ((res.start - 0x100) & 0xfff) >> 7 :
8de7a7d95049bd Hongbo Zhang             2013-09-26  1146  		   ((res.start - 0x200) & 0xfff) >> 7;
a1c03319018061 Ira Snyder               2010-01-06  1147  	if (chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) {
e7a29151de1bd5 Ira Snyder               2010-01-06  1148  		dev_err(fdev->dev, "too many channels for device\n");
173acc7ce8538f Zhang Wei                2008-03-01  1149  		err = -EINVAL;
e7a29151de1bd5 Ira Snyder               2010-01-06  1150  		goto out_iounmap_regs;
173acc7ce8538f Zhang Wei                2008-03-01  1151  	}
173acc7ce8538f Zhang Wei                2008-03-01  1152  
a1c03319018061 Ira Snyder               2010-01-06  1153  	fdev->chan[chan->id] = chan;
a1c03319018061 Ira Snyder               2010-01-06  1154  	tasklet_init(&chan->tasklet, dma_do_tasklet, (unsigned long)chan);
b158471ef63bf3 Ira Snyder               2011-03-03  1155  	snprintf(chan->name, sizeof(chan->name), "chan%d", chan->id);
e7a29151de1bd5 Ira Snyder               2010-01-06  1156  
e7a29151de1bd5 Ira Snyder               2010-01-06  1157  	/* Initialize the channel */
a1c03319018061 Ira Snyder               2010-01-06  1158  	dma_init(chan);
173acc7ce8538f Zhang Wei                2008-03-01  1159  
173acc7ce8538f Zhang Wei                2008-03-01  1160  	/* Clear cdar registers */
a1c03319018061 Ira Snyder               2010-01-06  1161  	set_cdar(chan, 0);
173acc7ce8538f Zhang Wei                2008-03-01  1162  
a1c03319018061 Ira Snyder               2010-01-06  1163  	switch (chan->feature & FSL_DMA_IP_MASK) {
173acc7ce8538f Zhang Wei                2008-03-01  1164  	case FSL_DMA_IP_85XX:
a1c03319018061 Ira Snyder               2010-01-06 @1165  		chan->toggle_ext_pause = fsl_chan_toggle_ext_pause;
173acc7ce8538f Zhang Wei                2008-03-01  1166  	case FSL_DMA_IP_83XX:
a1c03319018061 Ira Snyder               2010-01-06  1167  		chan->toggle_ext_start = fsl_chan_toggle_ext_start;
a1c03319018061 Ira Snyder               2010-01-06  1168  		chan->set_src_loop_size = fsl_chan_set_src_loop_size;
a1c03319018061 Ira Snyder               2010-01-06  1169  		chan->set_dst_loop_size = fsl_chan_set_dst_loop_size;
a1c03319018061 Ira Snyder               2010-01-06  1170  		chan->set_request_count = fsl_chan_set_request_count;
173acc7ce8538f Zhang Wei                2008-03-01  1171  	}
173acc7ce8538f Zhang Wei                2008-03-01  1172  
a1c03319018061 Ira Snyder               2010-01-06  1173  	spin_lock_init(&chan->desc_lock);
9c3a50b7d7ec45 Ira Snyder               2010-01-06  1174  	INIT_LIST_HEAD(&chan->ld_pending);
9c3a50b7d7ec45 Ira Snyder               2010-01-06  1175  	INIT_LIST_HEAD(&chan->ld_running);
43452fadd614b6 Hongbo Zhang             2014-05-21  1176  	INIT_LIST_HEAD(&chan->ld_completed);
f04cd40701deac Ira Snyder               2011-03-03  1177  	chan->idle = true;
14c6a3333c8e88 Hongbo Zhang             2014-05-21  1178  #ifdef CONFIG_PM
14c6a3333c8e88 Hongbo Zhang             2014-05-21  1179  	chan->pm_state = RUNNING;
14c6a3333c8e88 Hongbo Zhang             2014-05-21  1180  #endif
173acc7ce8538f Zhang Wei                2008-03-01  1181  
a1c03319018061 Ira Snyder               2010-01-06  1182  	chan->common.device = &fdev->common;
8ac695463f37af Russell King - ARM Linux 2012-03-06  1183  	dma_cookie_init(&chan->common);
173acc7ce8538f Zhang Wei                2008-03-01  1184  
d3f620b2c4fecd Ira Snyder               2010-01-06  1185  	/* find the IRQ line, if it exists in the device tree */
a1c03319018061 Ira Snyder               2010-01-06  1186  	chan->irq = irq_of_parse_and_map(node, 0);
d3f620b2c4fecd Ira Snyder               2010-01-06  1187  
173acc7ce8538f Zhang Wei                2008-03-01  1188  	/* Add the channel to DMA device channel list */
a1c03319018061 Ira Snyder               2010-01-06  1189  	list_add_tail(&chan->common.device_node, &fdev->common.channels);
173acc7ce8538f Zhang Wei                2008-03-01  1190  
a1c03319018061 Ira Snyder               2010-01-06  1191  	dev_info(fdev->dev, "#%d (%s), irq %d\n", chan->id, compatible,
aa570be6de67f3 Michael Ellerman         2016-09-10  1192  		 chan->irq ? chan->irq : fdev->irq);
173acc7ce8538f Zhang Wei                2008-03-01  1193  
173acc7ce8538f Zhang Wei                2008-03-01  1194  	return 0;
51ee87f27a1d2c Li Yang                  2008-05-29  1195  
e7a29151de1bd5 Ira Snyder               2010-01-06  1196  out_iounmap_regs:
a1c03319018061 Ira Snyder               2010-01-06  1197  	iounmap(chan->regs);
a1c03319018061 Ira Snyder               2010-01-06  1198  out_free_chan:
a1c03319018061 Ira Snyder               2010-01-06  1199  	kfree(chan);
e7a29151de1bd5 Ira Snyder               2010-01-06  1200  out_return:
173acc7ce8538f Zhang Wei                2008-03-01  1201  	return err;
173acc7ce8538f Zhang Wei                2008-03-01  1202  }
173acc7ce8538f Zhang Wei                2008-03-01  1203  

:::::: The code at line 1165 was first introduced by commit
:::::: a1c03319018061304be28d131073ac13a5cb86fb fsldma: rename fsl_chan to chan

:::::: TO: Ira Snyder <iws@...o.caltech.edu>
:::::: CC: Dan Williams <dan.j.williams@...el.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (13347 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ