From patchwork Tue Oct 24 15:34:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10025005 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 55AAF60245 for ; Tue, 24 Oct 2017 15:35:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45DC7209D8 for ; Tue, 24 Oct 2017 15:35:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39BC0285B7; Tue, 24 Oct 2017 15:35:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E78B7209D8 for ; Tue, 24 Oct 2017 15:35:04 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 211E326737B; Tue, 24 Oct 2017 17:34:48 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E2AE126737C; Tue, 24 Oct 2017 17:34:46 +0200 (CEST) Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by alsa0.perex.cz (Postfix) with ESMTP id 7E226266DB1 for ; Tue, 24 Oct 2017 17:34:44 +0200 (CEST) Received: by mail-pf0-f195.google.com with SMTP id b79so19957247pfk.5 for ; Tue, 24 Oct 2017 08:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=qeDIzyF8CvU8kpwBHb9Bz7WRhj/UZx6x3KK3e7k6GvY=; b=HwGYjJgdiB6Jp+lWtVOgVniM1ZZfNTc2655DC2UmlFFseKUqrZrbHGpU1s0O71CP9B 7LLV/wFgKolPgyLE1uekjsz/w07CCL4tTC9aXb+nfzku+LOwB0e0UBzxWZoERDU2R96c /NQPUlFT4lSX9hn8tKUYpuBwiVPLLcC+LjdOU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=qeDIzyF8CvU8kpwBHb9Bz7WRhj/UZx6x3KK3e7k6GvY=; b=U4uRKb6EWzotpcqbu5V2FBNblt/38Pu6Eo2mL5j56ceGohjpFl6E/1gNV8tAvQStbC BYhdWLXqKMletMgJOlAKKiI/XV822ds0bCl1A83coNExoeAwX13qXrOEnxZm/PbsyhQE BRepWqwxKOT0W/Mt5p51bNMtKlhLK46Mh/hgn++A6voMdLCp6jZlGSVdm/AyPWO4D5ps Q6I+W8TM64rVa3s5LuF8kPEkbhopSvfLgwa/O+JApfM0azo/cYdhhpIOwltsbcZsVSD4 KVNkUe9+2gjjBD86EEyAZxAO944h3Y+Tss6YC6bZfbMV/iOrL8EEvD90QKSqEzSp0CJ1 37iQ== X-Gm-Message-State: AMCzsaVausRgLnY4FlnvRJf1BAB4Enar3Drfkd0xW+fJdnS4wS4ZvrH1 7rPCptzGke4BVJ0ed8dpZVo8KL2LFeA= X-Google-Smtp-Source: ABhQp+QKlPQ1bEGynSjnpojfUxibmB2rkS9MMw6gx1USpmuCfQG3e4q7LJX3+rmTHFnpSsP6lx6CFQ== X-Received: by 10.98.198.195 with SMTP id x64mr16997044pfk.322.1508859282624; Tue, 24 Oct 2017 08:34:42 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id x27sm1203063pfe.172.2017.10.24.08.34.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Oct 2017 08:34:41 -0700 (PDT) Date: Tue, 24 Oct 2017 08:34:40 -0700 From: Kees Cook To: Takashi Iwai Message-ID: <20171024153440.GA112878@beast> MIME-Version: 1.0 Content-Disposition: inline Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ALSA: emux: Convert timers to use timer_setup() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Signed-off-by: Kees Cook --- sound/synth/emux/emux.c | 2 +- sound/synth/emux/emux_synth.c | 4 ++-- sound/synth/emux/emux_voice.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c index b9981e8c0027..b840ff2dcfbb 100644 --- a/sound/synth/emux/emux.c +++ b/sound/synth/emux/emux.c @@ -53,7 +53,7 @@ int snd_emux_new(struct snd_emux **remu) emu->max_voices = 0; emu->use_time = 0; - setup_timer(&emu->tlist, snd_emux_timer_callback, (unsigned long)emu); + timer_setup(&emu->tlist, snd_emux_timer_callback, 0); emu->timer_active = 0; *remu = emu; diff --git a/sound/synth/emux/emux_synth.c b/sound/synth/emux/emux_synth.c index 599551b5af44..9fa696b0dbde 100644 --- a/sound/synth/emux/emux_synth.c +++ b/sound/synth/emux/emux_synth.c @@ -202,9 +202,9 @@ snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan) * * release the pending note-offs */ -void snd_emux_timer_callback(unsigned long data) +void snd_emux_timer_callback(struct timer_list *t) { - struct snd_emux *emu = (struct snd_emux *) data; + struct snd_emux *emu = from_timer(emu, t, tlist); struct snd_emux_voice *vp; unsigned long flags; int ch, do_again = 0; diff --git a/sound/synth/emux/emux_voice.h b/sound/synth/emux/emux_voice.h index a7073c371bcc..326fa8993d7b 100644 --- a/sound/synth/emux/emux_voice.h +++ b/sound/synth/emux/emux_voice.h @@ -55,7 +55,7 @@ void snd_emux_update_channel(struct snd_emux_port *port, struct snd_midi_channel *chan, int update); void snd_emux_update_port(struct snd_emux_port *port, int update); -void snd_emux_timer_callback(unsigned long data); +void snd_emux_timer_callback(struct timer_list *t); /* emux_effect.c */ #ifdef SNDRV_EMUX_USE_RAW_EFFECT