tree:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
head:   af982758d0a9e5189e657de2bbab2f65f16c48cc
commit: b8bd28e32e5fc3ad2d8c80ad3978fabb523a1763 [21/42] usb: gadget: f_midi: 
Use snd_card_free_when_closed with refcount
config: i386-randconfig-x075-201733 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout b8bd28e32e5fc3ad2d8c80ad3978fabb523a1763
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/usb/gadget/function/f_midi.c: In function 'f_midi_register_card':
>> drivers/usb/gadget/function/f_midi.c:836:24: error: 'f_midi_rmidi_free' 
>> undeclared (first use in this function)
     rmidi->private_free = f_midi_rmidi_free;
                           ^~~~~~~~~~~~~~~~~
   drivers/usb/gadget/function/f_midi.c:836:24: note: each undeclared 
identifier is reported only once for each function it appears in
   At top level:
   drivers/usb/gadget/function/f_midi.c:1249:13: warning: 'f_midi_rmidi_free' 
defined but not used [-Wunused-function]
    static void f_midi_rmidi_free(struct snd_rawmidi *rmidi)
                ^~~~~~~~~~~~~~~~~

vim +/f_midi_rmidi_free +836 drivers/usb/gadget/function/f_midi.c

   792  
   793  /* register as a sound "card" */
   794  static int f_midi_register_card(struct f_midi *midi)
   795  {
   796          struct snd_card *card;
   797          struct snd_rawmidi *rmidi;
   798          int err;
   799          static struct snd_device_ops ops = {
   800                  .dev_free = f_midi_snd_free,
   801          };
   802  
   803          err = snd_card_new(&midi->gadget->dev, midi->index, midi->id,
   804                             THIS_MODULE, 0, &card);
   805          if (err < 0) {
   806                  ERROR(midi, "snd_card_new() failed\n");
   807                  goto fail;
   808          }
   809          midi->card = card;
   810  
   811          err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, midi, &ops);
   812          if (err < 0) {
   813                  ERROR(midi, "snd_device_new() failed: error %d\n", err);
   814                  goto fail;
   815          }
   816  
   817          strcpy(card->driver, f_midi_longname);
   818          strcpy(card->longname, f_midi_longname);
   819          strcpy(card->shortname, f_midi_shortname);
   820  
   821          /* Set up rawmidi */
   822          snd_component_add(card, "MIDI");
   823          err = snd_rawmidi_new(card, card->longname, 0,
   824                                midi->out_ports, midi->in_ports, &rmidi);
   825          if (err < 0) {
   826                  ERROR(midi, "snd_rawmidi_new() failed: error %d\n", 
err);
   827                  goto fail;
   828          }
   829          midi->rmidi = rmidi;
   830          midi->in_last_port = 0;
   831          strcpy(rmidi->name, card->shortname);
   832          rmidi->info_flags = SNDRV_RAWMIDI_INFO_OUTPUT |
   833                              SNDRV_RAWMIDI_INFO_INPUT |
   834                              SNDRV_RAWMIDI_INFO_DUPLEX;
   835          rmidi->private_data = midi;
 > 836          rmidi->private_free = f_midi_rmidi_free;
   837          midi->free_ref++;
   838  
   839          /*
   840           * Yes, rawmidi OUTPUT = USB IN, and rawmidi INPUT = USB OUT.
   841           * It's an upside-down world being a gadget.
   842           */
   843          snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, 
&gmidi_in_ops);
   844          snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, 
&gmidi_out_ops);
   845  
   846          /* register it - we're ready to go */
   847          err = snd_card_register(card);
   848          if (err < 0) {
   849                  ERROR(midi, "snd_card_register() failed\n");
   850                  goto fail;
   851          }
   852  
   853          VDBG(midi, "%s() finished ok\n", __func__);
   854          return 0;
   855  
   856  fail:
   857          f_midi_unregister_card(midi);
   858          return err;
   859  }
   860  

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

Attachment: .config.gz
Description: application/gzip

Reply via email to