Skip to contentSkip to conversation

sound/usb/mixer_s1810c.c:178:9: warning: missing braces around initializer

PATCH kbuild test robot 1 participant 1 message Feb 20, 2020

lore
Share & tools
lore

kbuild test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f4aba10148cd290bbbf4d0efae0e9789a13c2778
commit: 8dc5efe3d17cd572328ac4f1ebde629c83317f54 [2356/3478] ALSA: usb-audio: Add support for Presonus Studio 1810c
config: x86_64-randconfig-a003-20200220 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.2-10+deb8u1) 4.9.2
reproduce:
        git checkout 8dc5efe3d17cd572328ac4f1ebde629c83317f54
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag

All warnings (new ones prefixed by >>):

sound/usb/mixer_s1810c.c: In function 'snd_sc1810c_get_status_field':

>> sound/usb/mixer_s1810c.c:178:9: warning: missing braces around initializer [-Wmissing-braces]
     struct s1810c_state_packet pkt_out = { 0 };
            ^
   sound/usb/mixer_s1810c.c:178:9: warning: (near initialization for 'pkt_out.fields') [-Wmissing-braces]
   sound/usb/mixer_s1810c.c:179:9: warning: missing braces around initializer [-Wmissing-braces]
     struct s1810c_state_packet pkt_in = { 0 };
            ^

sound/usb/mixer_s1810c.c:179:9: warning: (near initialization for 'pkt_in.fields') [-Wmissing-braces]

vim +178 sound/usb/mixer_s1810c.c

164
165 /*
166 * When opening Universal Control the program periodicaly
167 * sends and receives state packets for syncinc state between
168 * the device and the host.
169 *
170 * Note that if we send only the request to get data back we'll
171 * get an error, we need to first send an empty state packet and
172 * then ask to receive a filled. Their seqnumbers must also match.
173 */
174 static int
175 snd_sc1810c_get_status_field(struct usb_device *dev,
176 u32 *field, int field_idx, uint16_t *seqnum)
177 {

 > 178		struct s1810c_state_packet pkt_out = { 0 };
   179		struct s1810c_state_packet pkt_in = { 0 };
   180		int ret = 0;
   181	
   182		pkt_out.fields[SC1810C_STATE_F1_IDX] = SC1810C_SET_STATE_F1;
   183		pkt_out.fields[SC1810C_STATE_F2_IDX] = SC1810C_SET_STATE_F2;
   184		ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
   185				      SC1810C_SET_STATE_REQ,
   186				      SC1810C_SET_STATE_REQTYPE,
   187				      (*seqnum), 0, &pkt_out, sizeof(pkt_out));
   188		if (ret < 0) {
   189			dev_warn(&dev->dev, "could not send state packet (%d)\n", ret);
   190			return ret;
   191		}
   192	
   193		ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
   194				      SC1810C_GET_STATE_REQ,
   195				      SC1810C_GET_STATE_REQTYPE,
   196				      (*seqnum), 0, &pkt_in, sizeof(pkt_in));

197 if (ret < 0) {
198 dev_warn(&dev->dev, "could not get state field %u (%d)\n",
199 field_idx, ret);
200 return ret;
201 }
202
203 (*field) = pkt_in.fields[field_idx];
204 (*seqnum)++;
205 return 0;
206 }
207

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org