From patchwork Tue Oct 24 15:35:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10025017 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 A179D60245 for ; Tue, 24 Oct 2017 15:35:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9211128520 for ; Tue, 24 Oct 2017 15:35:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86A9328A1A; Tue, 24 Oct 2017 15:35:38 +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 B71F928520 for ; Tue, 24 Oct 2017 15:35:37 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A091E2673C7; Tue, 24 Oct 2017 17:35:35 +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 1E3EE2673C4; Tue, 24 Oct 2017 17:35:34 +0200 (CEST) Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by alsa0.perex.cz (Postfix) with ESMTP id 8705A267380 for ; Tue, 24 Oct 2017 17:35:15 +0200 (CEST) Received: by mail-pf0-f194.google.com with SMTP id d28so19951766pfe.2 for ; Tue, 24 Oct 2017 08:35:15 -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=vmOvLkHpfyWt418c1+So3qIBSuAs8qjKcqy4/CCQrHc=; b=Fy+wqxYfkT0ziBwGtwGqH7x+xteILAJYcWgjgOmlO2zJAH4TOlJsWlfhpnMT0NBV9f dMRzprzuapz1aSSbxRTVic+z5KuGknSYRu5ygo3NotpaizoHjfVEgwObJO2iGhE75EFf Yyoo5UBnr/PBg1nharP/PPz/T0De7Md5KOs1I= 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=vmOvLkHpfyWt418c1+So3qIBSuAs8qjKcqy4/CCQrHc=; b=FEJf8MzFYemzpGRY4CezUESsxoA4bB8/Jaeme0z76eJRvU+F4DRlPZFG79DwG+IEJ1 h345JQIDrucd97KvhT+3MR8nXmj7oGOF61xntN3jRbvwsasd6I3drwMU37sGQ28hjkVa ylxHGgUDZaZeOoHwUXXlhjFVQXRiDE0yP92zXtRIb6o4R02rXXCdbVY34TBnOxOlnNyB 40lqnNT22A70YzhtnHA0V5GIOqS9kUiEYD+lA/Ywq7NVtDd+Fd759YTJECG0Tcm7u21t Y+NDbmCZdwTtTYzhQUHOV04ipLyk1ZEVCV92ne8FzO1V29fEBqMm4nixUUv25jItX0kL gyqQ== X-Gm-Message-State: AMCzsaXBGwZ0zseuzZLL5I8U5GRJDmzsTEiGLx4wf6EpxHDPfDOhxzHi bKsNmU2F4MaPiBemW1epJcskyuHjlIo= X-Google-Smtp-Source: ABhQp+Q3cByfRROB4Y8wGZUCv8YyU8g2XBasdD+Aw+mRsVBL57azVnqz6OpDTim9l6Uj0py3u8cj2A== X-Received: by 10.101.88.70 with SMTP id s6mr15316146pgr.216.1508859311845; Tue, 24 Oct 2017 08:35:11 -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 g5sm930841pgq.94.2017.10.24.08.35.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Oct 2017 08:35:10 -0700 (PDT) Date: Tue, 24 Oct 2017 08:35:09 -0700 From: Kees Cook To: Takashi Iwai Message-ID: <20171024153509.GA112907@beast> MIME-Version: 1.0 Content-Disposition: inline Cc: alsa-devel@alsa-project.org, Takashi Sakamoto , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ALSA: wavefront: 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: Takashi Sakamoto Cc: alsa-devel@alsa-project.org Signed-off-by: Kees Cook --- include/sound/snd_wavefront.h | 1 + sound/isa/wavefront/wavefront_midi.c | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/sound/snd_wavefront.h b/include/sound/snd_wavefront.h index cd0bab1ef6f1..fcd770fdcda5 100644 --- a/include/sound/snd_wavefront.h +++ b/include/sound/snd_wavefront.h @@ -28,6 +28,7 @@ struct _snd_wavefront_midi { struct snd_rawmidi_substream *substream_output[2]; struct snd_rawmidi_substream *substream_input[2]; struct timer_list timer; + snd_wavefront_card_t *timer_card; spinlock_t open; spinlock_t virtual; /* protects isvirtual */ }; diff --git a/sound/isa/wavefront/wavefront_midi.c b/sound/isa/wavefront/wavefront_midi.c index 2aa05f3aaa38..556b14738970 100644 --- a/sound/isa/wavefront/wavefront_midi.c +++ b/sound/isa/wavefront/wavefront_midi.c @@ -349,10 +349,10 @@ static void snd_wavefront_midi_input_trigger(struct snd_rawmidi_substream *subst spin_unlock_irqrestore (&midi->virtual, flags); } -static void snd_wavefront_midi_output_timer(unsigned long data) +static void snd_wavefront_midi_output_timer(struct timer_list *t) { - snd_wavefront_card_t *card = (snd_wavefront_card_t *)data; - snd_wavefront_midi_t *midi = &card->wavefront.midi; + snd_wavefront_midi_t *midi = from_timer(midi, t, timer); + snd_wavefront_card_t *card = midi->timer_card; unsigned long flags; spin_lock_irqsave (&midi->virtual, flags); @@ -383,9 +383,9 @@ static void snd_wavefront_midi_output_trigger(struct snd_rawmidi_substream *subs if (up) { if ((midi->mode[mpu] & MPU401_MODE_OUTPUT_TRIGGER) == 0) { if (!midi->istimer) { - setup_timer(&midi->timer, + timer_setup(&midi->timer, snd_wavefront_midi_output_timer, - (unsigned long) substream->rmidi->card->private_data); + 0); mod_timer(&midi->timer, 1 + jiffies); } midi->istimer++;