diff options
Diffstat (limited to 'sound/drivers/pcmtest.c')
| -rw-r--r-- | sound/drivers/pcmtest.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sound/drivers/pcmtest.c b/sound/drivers/pcmtest.c index 21cefaf5419a..b8474631f0b5 100644 --- a/sound/drivers/pcmtest.c +++ b/sound/drivers/pcmtest.c @@ -36,6 +36,7 @@ #include <sound/core.h> #include <linux/dma-mapping.h> #include <linux/platform_device.h> +#include <linux/string.h> #include <linux/timer.h> #include <linux/random.h> #include <linux/debugfs.h> @@ -345,7 +346,7 @@ static void timer_timeout(struct timer_list *data) struct pcmtst_buf_iter *v_iter; struct snd_pcm_substream *substream; - v_iter = from_timer(v_iter, data, timer_instance); + v_iter = timer_container_of(v_iter, data, timer_instance); substream = v_iter->substream; if (v_iter->suspend) @@ -555,7 +556,7 @@ static int snd_pcmtst_new_pcm(struct pcmtst *pcmtst) if (err < 0) return err; pcm->private_data = pcmtst; - strcpy(pcm->name, "PCMTest"); + strscpy(pcm->name, "PCMTest"); pcmtst->pcm = pcm; snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_pcmtst_playback_ops); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_pcmtst_capture_ops); @@ -613,9 +614,9 @@ static int pcmtst_probe(struct platform_device *pdev) if (err < 0) return err; - strcpy(card->driver, "PCM-TEST Driver"); - strcpy(card->shortname, "PCM-Test"); - strcpy(card->longname, "PCM-Test virtual driver"); + strscpy(card->driver, "PCM-TEST Driver"); + strscpy(card->shortname, "PCM-Test"); + strscpy(card->longname, "PCM-Test virtual driver"); err = snd_card_register(card); if (err < 0) @@ -640,7 +641,7 @@ static struct platform_device pcmtst_pdev = { static struct platform_driver pcmtst_pdrv = { .probe = pcmtst_probe, - .remove_new = pdev_remove, + .remove = pdev_remove, .driver = { .name = "pcmtest", }, @@ -695,10 +696,10 @@ static int setup_patt_bufs(void) size_t i; for (i = 0; i < ARRAY_SIZE(patt_bufs); i++) { - patt_bufs[i].buf = kzalloc(MAX_PATTERN_LEN, GFP_KERNEL); + patt_bufs[i].buf = kmalloc(MAX_PATTERN_LEN, GFP_KERNEL); if (!patt_bufs[i].buf) break; - strcpy(patt_bufs[i].buf, DEFAULT_PATTERN); + strscpy_pad(patt_bufs[i].buf, DEFAULT_PATTERN, MAX_PATTERN_LEN); patt_bufs[i].len = DEFAULT_PATTERN_LEN; } |
