From patchwork Tue Oct 24 15:35:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10025019 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 E495D60245 for ; Tue, 24 Oct 2017 15:35:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5B1E289FF for ; Tue, 24 Oct 2017 15:35:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA84028A1C; Tue, 24 Oct 2017 15:35:53 +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 140C928A1A for ; Tue, 24 Oct 2017 15:35:53 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 44CC626738C; Tue, 24 Oct 2017 17:35:46 +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 E163E267387; Tue, 24 Oct 2017 17:35:45 +0200 (CEST) Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by alsa0.perex.cz (Postfix) with ESMTP id 77C2026738C for ; Tue, 24 Oct 2017 17:35:24 +0200 (CEST) Received: by mail-pf0-f196.google.com with SMTP id 17so19946658pfn.12 for ; Tue, 24 Oct 2017 08:35:24 -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=Y7WO6WHsLVf0cjxJCW27qazG6GJY8DoqeitryyNpIZU=; b=K+Pr63MMpryfAAdB8d/lkeQBoM+q3qK1MW8fPaEeiePLSUL2qZ/NYP7gV3QDfzL8lP zSo3121wrFvJemCoISXbRD/a09yzspLiQ7j4u/jj2W0bFyKVwV8BynIzsR0gfGC2dqZo tmfGN7j8NQBcXfQ7bEvFzGiB6So4i9nQ/r5Ts= 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=Y7WO6WHsLVf0cjxJCW27qazG6GJY8DoqeitryyNpIZU=; b=rjgaAwbm1l798uwp8Q5K7HhvLDajPnmSvYDDQBrDI9oYE1iT9k8CndZoXVtMdjslDB 18wyItTZbcNj2jqdnl3/XYl8EbHx0veXQDZnhcE0pG1aWZ73aJDmPPaNGjDMJlGke/QX 5kyMPK8ra4mrTzkkONemEqkKZpBZixd5K1Dg/71bfYwIVw5OBBV0bIbP5tZV1x2v4heT jNswJ7UrCflW4xiCX5aLHHKvPFig1R12wBxYxue4zSJyyBfgd3V60ItOoA7vxc8ex/J1 UqzG7kNcCdo8vo7NvCVvZlXUIWBge8kt/tKSxoV0BIfBgXEXgLPqhjphX3oWBlEu9zlm i1eQ== X-Gm-Message-State: AMCzsaVcFj9deatVS1SpyDin7okxoC+XOX+pHuHPDy/7ph85OV+Z5xzL TOOAwBMW2AYCcJ2/LQv7OAAXRThpgr8= X-Google-Smtp-Source: ABhQp+ToIr4jCIoQOETWcxZvKmytOfmUXnv5em5DXME4CL8RLdnNdvpX7EScAYgcpRFNHpaje9pFDA== X-Received: by 10.84.128.68 with SMTP id 62mr13139716pla.442.1508859323239; Tue, 24 Oct 2017 08:35:23 -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 f10sm1091112pgr.8.2017.10.24.08.35.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Oct 2017 08:35:22 -0700 (PDT) Date: Tue, 24 Oct 2017 08:35:21 -0700 From: Kees Cook To: Takashi Iwai Message-ID: <20171024153521.GA112921@beast> MIME-Version: 1.0 Content-Disposition: inline Cc: David Howells , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] sound: oss: waveartist: 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: David Howells Cc: alsa-devel@alsa-project.org Signed-off-by: Kees Cook --- sound/oss/waveartist.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sound/oss/waveartist.c b/sound/oss/waveartist.c index 4f0c3a232e41..c051c8e6023e 100644 --- a/sound/oss/waveartist.c +++ b/sound/oss/waveartist.c @@ -151,6 +151,7 @@ static DEFINE_SPINLOCK(waveartist_lock); #define machine_is_netwinder() 0 #else static struct timer_list vnc_timer; +static int timer_nr_waveartist_devs; static void vnc_configure_mixer(struct wavnc_info *devc, unsigned int input_mask); static int vnc_private_ioctl(int dev, unsigned int cmd, int __user *arg); @@ -1414,8 +1415,8 @@ attach_waveartist(struct address_info *hw, const struct waveartist_mixer_info *m else { #ifdef CONFIG_ARCH_NETWINDER if (machine_is_netwinder()) { - setup_timer(&vnc_timer, vnc_slider_tick, - nr_waveartist_devs); + timer_nr_waveartist_devs = nr_waveartist_devs; + timer_setup(&vnc_timer, vnc_slider_tick, 0); mod_timer(&vnc_timer, jiffies); vnc_configure_mixer(devc, 0); @@ -1799,11 +1800,11 @@ vnc_slider(struct wavnc_info *devc) } static void -vnc_slider_tick(unsigned long data) +vnc_slider_tick(struct timer_list *unused) { int next_timeout; - if (vnc_slider(adev_info + data)) + if (vnc_slider(adev_info + timer_nr_waveartist_devs)) next_timeout = 5; // mixer reported change else next_timeout = VNC_TIMER_PERIOD;