Re: [PATCH V1 6/6] staging: greybus: audio: Enable GB codec, audio module compilation.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Vaibhav,

I love your patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v5.7-rc6 next-20200519]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Vaibhav-Agarwal/Enable-Greybus-Audio-codec-driver/20200518-012023
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git cef077e6aa4c7dbe2f23e1201cf705f9540ec467
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/staging/greybus/audio_helper.c:59:5: warning: no previous prototype for function 'gbaudio_dapm_link_component_dai_widgets' [-Wmissing-prototypes]
int gbaudio_dapm_link_component_dai_widgets(struct snd_soc_card *card,
^
drivers/staging/greybus/audio_helper.c:59:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int gbaudio_dapm_link_component_dai_widgets(struct snd_soc_card *card,
^
static
>> drivers/staging/greybus/audio_helper.c:112:5: warning: no previous prototype for function 'gbaudio_dapm_free_controls' [-Wmissing-prototypes]
int gbaudio_dapm_free_controls(struct snd_soc_dapm_context *dapm,
^
drivers/staging/greybus/audio_helper.c:112:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int gbaudio_dapm_free_controls(struct snd_soc_dapm_context *dapm,
^
static
>> drivers/staging/greybus/audio_helper.c:189:5: warning: no previous prototype for function 'gbaudio_remove_component_controls' [-Wmissing-prototypes]
int gbaudio_remove_component_controls(struct snd_soc_component *component,
^
drivers/staging/greybus/audio_helper.c:189:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int gbaudio_remove_component_controls(struct snd_soc_component *component,
^
static
3 warnings generated.

vim +/gbaudio_dapm_link_component_dai_widgets +59 drivers/staging/greybus/audio_helper.c

94b08a33fd1bca Vaibhav Agarwal 2020-05-17   58  
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  @59  int gbaudio_dapm_link_component_dai_widgets(struct snd_soc_card *card,
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   60  					    struct snd_soc_dapm_context *dapm)
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   61  {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   62  	struct snd_soc_dapm_widget *dai_w;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   63  
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   64  	/* For each DAI widget... */
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   65  	list_for_each_entry(dai_w, &card->widgets, list) {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   66  		if (dai_w->dapm != dapm)
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   67  			continue;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   68  		switch (dai_w->id) {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   69  		case snd_soc_dapm_dai_in:
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   70  		case snd_soc_dapm_dai_out:
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   71  			break;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   72  		default:
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   73  			continue;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   74  		}
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   75  		gbaudio_dapm_link_dai_widget(dai_w, card);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   76  	}
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   77  
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   78  	return 0;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   79  }
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   80  
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   81  static void gbaudio_dapm_free_path(struct snd_soc_dapm_path *path)
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   82  {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   83  	list_del(&path->list_node[SND_SOC_DAPM_DIR_IN]);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   84  	list_del(&path->list_node[SND_SOC_DAPM_DIR_OUT]);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   85  	list_del(&path->list_kcontrol);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   86  	list_del(&path->list);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   87  	kfree(path);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   88  }
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   89  
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   90  static void gbaudio_dapm_free_widget(struct snd_soc_dapm_widget *w)
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   91  {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   92  	struct snd_soc_dapm_path *p, *next_p;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   93  	enum snd_soc_dapm_direction dir;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   94  
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   95  	list_del(&w->list);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   96  	/*
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   97  	 * remove source and sink paths associated to this widget.
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   98  	 * While removing the path, remove reference to it from both
94b08a33fd1bca Vaibhav Agarwal 2020-05-17   99  	 * source and sink widgets so that path is removed only once.
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  100  	 */
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  101  	gbaudio_dapm_for_each_direction(dir) {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  102  		snd_soc_dapm_widget_for_each_path_safe(w, dir, p, next_p)
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  103  			gbaudio_dapm_free_path(p);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  104  	}
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  105  
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  106  	kfree(w->kcontrols);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  107  	kfree_const(w->name);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  108  	kfree_const(w->sname);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  109  	kfree(w);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  110  }
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  111  
94b08a33fd1bca Vaibhav Agarwal 2020-05-17 @112  int gbaudio_dapm_free_controls(struct snd_soc_dapm_context *dapm,
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  113  			       const struct snd_soc_dapm_widget *widget,
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  114  			       int num)
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  115  {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  116  	int i;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  117  	struct snd_soc_dapm_widget *w, *next_w;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  118  #ifdef CONFIG_DEBUG_FS
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  119  	struct dentry *parent = dapm->debugfs_dapm;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  120  	struct dentry *debugfs_w = NULL;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  121  #endif
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  122  
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  123  	mutex_lock(&dapm->card->dapm_mutex);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  124  	for (i = 0; i < num; i++) {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  125  		/* below logic can be optimized to identify widget pointer */
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  126  		list_for_each_entry_safe(w, next_w, &dapm->card->widgets,
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  127  					 list) {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  128  			if (w->dapm != dapm)
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  129  				continue;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  130  			if (!strcmp(w->name, widget->name))
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  131  				break;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  132  			w = NULL;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  133  		}
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  134  		if (!w) {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  135  			dev_err(dapm->dev, "%s: widget not found\n",
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  136  				widget->name);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  137  			return -EINVAL;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  138  		}
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  139  		widget++;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  140  #ifdef CONFIG_DEBUG_FS
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  141  		if (!parent)
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  142  			debugfs_w = debugfs_lookup(w->name, parent);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  143  		debugfs_remove(debugfs_w);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  144  		debugfs_w = NULL;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  145  #endif
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  146  		gbaudio_dapm_free_widget(w);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  147  	}
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  148  	mutex_unlock(&dapm->card->dapm_mutex);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  149  	return 0;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  150  }
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  151  
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  152  static int gbaudio_remove_controls(struct snd_card *card, struct device *dev,
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  153  				   const struct snd_kcontrol_new *controls,
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  154  				   int num_controls, const char *prefix)
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  155  {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  156  	int i, err;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  157  
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  158  	for (i = 0; i < num_controls; i++) {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  159  		const struct snd_kcontrol_new *control = &controls[i];
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  160  		struct snd_ctl_elem_id id;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  161  		struct snd_kcontrol *kctl;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  162  
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  163  		if (prefix)
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  164  			snprintf(id.name, sizeof(id.name), "%s %s", prefix,
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  165  				 control->name);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  166  		else
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  167  			strlcpy(id.name, control->name, sizeof(id.name));
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  168  		id.numid = 0;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  169  		id.iface = control->iface;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  170  		id.device = control->device;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  171  		id.subdevice = control->subdevice;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  172  		id.index = control->index;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  173  		kctl = snd_ctl_find_id(card, &id);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  174  		if (!kctl) {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  175  			dev_err(dev, "%d: Failed to find %s\n", err,
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  176  				control->name);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  177  			return -ENOENT;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  178  		}
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  179  		err = snd_ctl_remove(card, kctl);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  180  		if (err < 0) {
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  181  			dev_err(dev, "%d: Failed to remove %s\n", err,
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  182  				control->name);
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  183  			return err;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  184  		}
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  185  	}
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  186  	return 0;
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  187  }
94b08a33fd1bca Vaibhav Agarwal 2020-05-17  188  
94b08a33fd1bca Vaibhav Agarwal 2020-05-17 @189  int gbaudio_remove_component_controls(struct snd_soc_component *component,

:::::: The code at line 59 was first introduced by commit
:::::: 94b08a33fd1bcaa8660430f8107b5c7bbfbca3b4 staging: greybus: audio: Add helper APIs for dynamic audio modules

:::::: TO: Vaibhav Agarwal <vaibhav.sr@xxxxxxxxx>
:::::: CC: 0day robot <lkp@xxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux