Re: [PATCH] Staging: pi433: fix some warnings detected using sparse

From: kbuild test robot
Date: Sat Jul 29 2017 - 09:37:48 EST


Hi Elia,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on next-20170728]
[cannot apply to v4.13-rc2]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Elia-Geretto/Staging-pi433-fix-some-warnings-detected-using-sparse/20170729-205713
config: blackfin-allyesconfig (attached as .config)
compiler: bfin-uclinux-gcc (GCC) 6.2.0
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=blackfin

All errors (new ones prefixed by >>):

drivers/staging//pi433/pi433_if.c: In function 'rf69_set_rx_cfg':
>> drivers/staging//pi433/pi433_if.c:213:2: error: 'else' without a previous 'if'
else
^~~~
drivers/staging//pi433/pi433_if.c: In function 'rf69_set_tx_cfg':
drivers/staging//pi433/pi433_if.c:272:2: error: 'else' without a previous 'if'
else
^~~~

vim +213 drivers/staging//pi433/pi433_if.c

181
182 static int
183 rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg)
184 {
185 int payload_length;
186
187 /* receiver config */
188 SET_CHECKED(rf69_set_frequency (dev->spi, rx_cfg->frequency));
189 SET_CHECKED(rf69_set_bit_rate (dev->spi, rx_cfg->bit_rate));
190 SET_CHECKED(rf69_set_modulation (dev->spi, rx_cfg->modulation));
191 SET_CHECKED(rf69_set_antenna_impedance (dev->spi, rx_cfg->antenna_impedance));
192 SET_CHECKED(rf69_set_rssi_threshold (dev->spi, rx_cfg->rssi_threshold));
193 SET_CHECKED(rf69_set_ook_threshold_dec (dev->spi, rx_cfg->thresholdDecrement));
194 SET_CHECKED(rf69_set_bandwidth (dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent));
195 SET_CHECKED(rf69_set_bandwidth_during_afc(dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent));
196 SET_CHECKED(rf69_set_dagc (dev->spi, rx_cfg->dagc));
197
198 dev->rx_bytes_to_drop = rx_cfg->bytes_to_drop;
199
200 /* packet config */
201 /* enable */
202 SET_CHECKED(rf69_set_sync_enable(dev->spi, rx_cfg->enable_sync));
203 if (rx_cfg->enable_sync == optionOn)
204 {
205 SET_CHECKED(rf69_set_fifo_fill_condition(dev->spi, afterSyncInterrupt));
206 }
207 else
208 {
209 SET_CHECKED(rf69_set_fifo_fill_condition(dev->spi, always));
210 }
211 if (rx_cfg->enable_length_byte == optionOn)
212 SET_CHECKED(rf69_set_packet_format(dev->spi, packetLengthVar));
> 213 else
214 SET_CHECKED(rf69_set_packet_format(dev->spi, packetLengthFix));
215 SET_CHECKED(rf69_set_adressFiltering(dev->spi, rx_cfg->enable_address_filtering));
216 SET_CHECKED(rf69_set_crc_enable (dev->spi, rx_cfg->enable_crc));
217
218 /* lengths */
219 SET_CHECKED(rf69_set_sync_size(dev->spi, rx_cfg->sync_length));
220 if (rx_cfg->enable_length_byte == optionOn)
221 {
222 SET_CHECKED(rf69_set_payload_length(dev->spi, 0xff));
223 }
224 else if (rx_cfg->fixed_message_length != 0)
225 {
226 payload_length = rx_cfg->fixed_message_length;
227 if (rx_cfg->enable_length_byte == optionOn) payload_length++;
228 if (rx_cfg->enable_address_filtering != filteringOff) payload_length++;
229 SET_CHECKED(rf69_set_payload_length(dev->spi, payload_length));
230 }
231 else
232 {
233 SET_CHECKED(rf69_set_payload_length(dev->spi, 0));
234 }
235
236 /* values */
237 if (rx_cfg->enable_sync == optionOn)
238 {
239 SET_CHECKED(rf69_set_sync_values(dev->spi, rx_cfg->sync_pattern));
240 }
241 if (rx_cfg->enable_address_filtering != filteringOff)
242 {
243 SET_CHECKED(rf69_set_node_address (dev->spi, rx_cfg->node_address));
244 SET_CHECKED(rf69_set_broadcast_address(dev->spi, rx_cfg->broadcast_address));
245 }
246
247 return 0;
248 }
249

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

Attachment: .config.gz
Description: application/gzip