Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba26d556 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: Fix usage of banned functions"

parents e61b7821 156153df
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2061,7 +2061,7 @@ static ssize_t suspended_show(struct device *dev, struct device_attribute *attr,
	struct usb_gadget *gadget = dev_to_usb_gadget(dev);
	struct usb_composite_dev *cdev = get_gadget_data(gadget);

	return sprintf(buf, "%d\n", cdev->suspended);
	return snprintf(buf, PAGE_SIZE, "%d\n", cdev->suspended);
}
static DEVICE_ATTR_RO(suspended);

+6 −5
Original line number Diff line number Diff line
@@ -562,7 +562,7 @@ static int snd_uac2_probe(struct platform_device *pdev)
	if (err < 0)
		goto snd_fail;

	strcpy(pcm->name, "UAC2 PCM");
	strlcpy(pcm->name, "UAC2 PCM", sizeof(pcm->name));
	pcm->private_data = uac2;

	uac2->pcm = pcm;
@@ -570,9 +570,10 @@ static int snd_uac2_probe(struct platform_device *pdev)
	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &uac2_pcm_ops);
	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &uac2_pcm_ops);

	strcpy(card->driver, "UAC2_Gadget");
	strcpy(card->shortname, "UAC2_Gadget");
	sprintf(card->longname, "UAC2_Gadget %i", pdev->id);
	strlcpy(card->driver, "UAC2_Gadget", sizeof(card->driver));
	strlcpy(card->shortname, "UAC2_Gadget", sizeof(card->shortname));
	snprintf(card->longname, sizeof(card->longname),
			"UAC2_Gadget %i", pdev->id);

	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
		snd_dma_continuous_data(GFP_KERNEL), 0, BUFF_SIZE_MAX);
@@ -2175,7 +2176,7 @@ static ssize_t f_uac2_opts_##name##_show(struct f_uac2_opts *opts, \
	int result;							\
									\
	mutex_lock(&opts->lock);					\
	result = sprintf(page, "%u\n", opts->name);			\
	result = snprintf(page, PAGE_SIZE, "%u\n", opts->name);		\
	mutex_unlock(&opts->lock);					\
									\
	return result;							\