From patchwork Tue Oct 24 15:13:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10024809 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 42F626035E for ; Tue, 24 Oct 2017 15:13:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30AA8288EC for ; Tue, 24 Oct 2017 15:13:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22AC228A1E; Tue, 24 Oct 2017 15:13:50 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9E323288EC for ; Tue, 24 Oct 2017 15:13:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EB3486E543; Tue, 24 Oct 2017 15:13:48 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id BAA326E551 for ; Tue, 24 Oct 2017 15:13:47 +0000 (UTC) Received: by mail-pg0-x244.google.com with SMTP id j3so14784272pga.1 for ; Tue, 24 Oct 2017 08:13:47 -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=EANJPVATL8TD5/O+/f8zYUO17v/gJPEeVm21F2LYEiY=; b=crBm9yI3ZymKZYpyQFDpkfJvnlOOuahxR5f4i3jTywjC3uhrMxhMq9dzifCqI/WuG0 Bw3Lq0Tmq8Wdg969JCB9x9apm2ErlJHhp3EXFMWdCMiDo42vD7f5mGfM3dX1foJMuCcR UJTNJdXnHTxIU/LId5TeZCr8QMF0gYaNL+bcI= 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=EANJPVATL8TD5/O+/f8zYUO17v/gJPEeVm21F2LYEiY=; b=hg0Ks9MPWN63+weBPLQAaSKtcDpufWrWg38cjJa2LbCEL1i4mqN0xZwzYCqiWAQ1N0 ZtL4J3Hj/UZhJlrsldb+Max4KN07RDhkhLqEd2oAw0A3GD9qV95Cc3RtzJ/DRXqZ+9hK 9/wSK52fSDNHW/amGeHw3Nl9IHLvHwOmg6SvffXD0uPddz77LXWQ3bPeAU18IeBQ/hC1 8rD2fzT5X0/8p53ut7M9pUMJ/hSue7kC10/X3ahYkOoYD/FLbyJgm5CnBpub2Q3RqlEM Mkv5yBJDRKLTBfcNOB7Q3Wl9mJPpl4Jcl0qDSVbto2Z3KfvG296mO9NnLySKCLlifwid 9p/w== X-Gm-Message-State: AMCzsaXz4mfwBVYqpsHNE/nryoa5QuEOVaffNkWjWMnpn9vw3f70/1mP pbo0b5tRjZoJfEpAemIYeHxfLA== X-Google-Smtp-Source: ABhQp+SIFrcirkIxFOZvOP86VVolb73eYN2TYW9Rbk6r375FNRIK1Xsw6cIkEYZRNywxXI4hozOz+g== X-Received: by 10.101.74.81 with SMTP id a17mr14690783pgu.392.1508858027237; Tue, 24 Oct 2017 08:13:47 -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 h10sm907082pgn.73.2017.10.24.08.13.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Oct 2017 08:13:45 -0700 (PDT) Date: Tue, 24 Oct 2017 08:13:44 -0700 From: Kees Cook To: Jani Nikula Message-ID: <20171024151344.GA104417@beast> MIME-Version: 1.0 Content-Disposition: inline Cc: David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rodrigo Vivi Subject: [Intel-gfx] [PATCH] drm/i915/selftests: Convert timers to use timer_setup() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: David Airlie Cc: Tvrtko Ursulin Cc: Chris Wilson Cc: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Chris Wilson Acked-by: Jani Nikula --- drivers/gpu/drm/i915/selftests/lib_sw_fence.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/selftests/lib_sw_fence.c b/drivers/gpu/drm/i915/selftests/lib_sw_fence.c index 3790fdf44a1a..b26f07b55d86 100644 --- a/drivers/gpu/drm/i915/selftests/lib_sw_fence.c +++ b/drivers/gpu/drm/i915/selftests/lib_sw_fence.c @@ -49,9 +49,9 @@ void onstack_fence_fini(struct i915_sw_fence *fence) i915_sw_fence_fini(fence); } -static void timed_fence_wake(unsigned long data) +static void timed_fence_wake(struct timer_list *t) { - struct timed_fence *tf = (struct timed_fence *)data; + struct timed_fence *tf = from_timer(tf, t, timer); i915_sw_fence_commit(&tf->fence); } @@ -60,7 +60,7 @@ void timed_fence_init(struct timed_fence *tf, unsigned long expires) { onstack_fence_init(&tf->fence); - setup_timer_on_stack(&tf->timer, timed_fence_wake, (unsigned long)tf); + timer_setup_on_stack(&tf->timer, timed_fence_wake, 0); if (time_after(expires, jiffies)) mod_timer(&tf->timer, expires);