From patchwork Thu Oct 5 00:54:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9986181 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 433BB60291 for ; Thu, 5 Oct 2017 00:54:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34609228C9 for ; Thu, 5 Oct 2017 00:54:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2936928C22; Thu, 5 Oct 2017 00:54:12 +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 C933B228C9 for ; Thu, 5 Oct 2017 00:54:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 070E06E171; Thu, 5 Oct 2017 00:54:11 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pg0-x236.google.com (mail-pg0-x236.google.com [IPv6:2607:f8b0:400e:c05::236]) by gabe.freedesktop.org (Postfix) with ESMTPS id C73906E21E for ; Thu, 5 Oct 2017 00:54:09 +0000 (UTC) Received: by mail-pg0-x236.google.com with SMTP id i195so7411616pgd.9 for ; Wed, 04 Oct 2017 17:54:09 -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=EKYTU0sCvKZWt0NidA5Jb5MmfhbNHWHVvNSEB2jW7/c=; b=d4h3SxFTYT4S+PJW+cuF1OhTJsvhaXSIRhTFJK5b0ER+atWL9D7qCYS6pbbD4evqvl elEUZWTfM/XNJau/6JomuGLiivqnPxKNxS6vh76EOQ36/NQ3cR7je0rfQilTnRBigL2R NPAdP6pPFSH5kxJI+g+EY+W3qP3bJH9eNB8DY= 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=EKYTU0sCvKZWt0NidA5Jb5MmfhbNHWHVvNSEB2jW7/c=; b=LJ/wV4JsEOfDoHU6htKqJEZ87tQzaQbLPJWE9Id/ikMQIiRvPZ+f52c/rSlEpEZvG+ IYUa7//hWU5LRJE/Er3Y47ejq4BDvCE87l2AJu072i4cacNJqx1HJCKsDdqw3UG9jewP 94YeC/334L2H+KDqjk2wNbYHcJ7QTxvUn3g6TN6Cc3gdJFG74svRZFpE1Mf0JWYPhXx3 G0CT5uuowxbJDz3Z/Edtv6rIOtVc6BLy6KrJeBoty3K+HDWHuknfe5tdOuOfN6xIxDpj +ci25FUYWhv2Kahuq2PpkpzpQW1lQWab5iXXMTNlCMQBjLarQ4KtnbfKPN7FcizyDgJY 7qpA== X-Gm-Message-State: AHPjjUiEmAqT0zm0td+UbBUh9arzsseEfX6WR1UvmkAYE8V++qYIACkV AXn4nYYmjfp24+K5jF3XE/Eydw== X-Google-Smtp-Source: AOwi7QDKmlafsQVJCgKcCE6YWYSMcgdpwKcXglpDKFlOijJskNIGYl+TqTzlhXrzEmq/P3Yj7R543g== X-Received: by 10.159.198.72 with SMTP id y8mr21763697plt.410.1507164849291; Wed, 04 Oct 2017 17:54:09 -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 z8sm6009805pfg.23.2017.10.04.17.54.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2017 17:54:08 -0700 (PDT) Date: Wed, 4 Oct 2017 17:54:07 -0700 From: Kees Cook To: linux-kernel@vger.kernel.org Message-ID: <20171005005407.GA23894@beast> MIME-Version: 1.0 Content-Disposition: inline Cc: David Airlie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Thomas Gleixner Subject: [Intel-gfx] [PATCH] drm/i915: 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: Daniel Vetter Cc: Jani Nikula Cc: David Airlie Cc: Chris Wilson Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Cc: Oscar Mateo Cc: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: Thomas Gleixner Signed-off-by: Kees Cook Reviewed-by: Joonas Lahtinen --- This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone. --- drivers/gpu/drm/i915/selftests/mock_engine.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/selftests/mock_engine.c b/drivers/gpu/drm/i915/selftests/mock_engine.c index fc0fd7498689..331c2b09869e 100644 --- a/drivers/gpu/drm/i915/selftests/mock_engine.c +++ b/drivers/gpu/drm/i915/selftests/mock_engine.c @@ -32,9 +32,9 @@ static struct mock_request *first_request(struct mock_engine *engine) link); } -static void hw_delay_complete(unsigned long data) +static void hw_delay_complete(struct timer_list *t) { - struct mock_engine *engine = (typeof(engine))data; + struct mock_engine *engine = from_timer(engine, t, hw_delay); struct mock_request *request; spin_lock(&engine->hw_lock); @@ -161,9 +161,7 @@ struct intel_engine_cs *mock_engine(struct drm_i915_private *i915, /* fake hw queue */ spin_lock_init(&engine->hw_lock); - setup_timer(&engine->hw_delay, - hw_delay_complete, - (unsigned long)engine); + timer_setup(&engine->hw_delay, hw_delay_complete, 0); INIT_LIST_HEAD(&engine->hw_queue); return &engine->base;