From patchwork Mon Oct 16 23:21:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10010119 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 DE0F660235 for ; Mon, 16 Oct 2017 23:21:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF48C28676 for ; Mon, 16 Oct 2017 23:21:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3C45286EF; Mon, 16 Oct 2017 23:21:39 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4441B28676 for ; Mon, 16 Oct 2017 23:21:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757313AbdJPXVi (ORCPT ); Mon, 16 Oct 2017 19:21:38 -0400 Received: from mail-pg0-f47.google.com ([74.125.83.47]:47210 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757264AbdJPXVh (ORCPT ); Mon, 16 Oct 2017 19:21:37 -0400 Received: by mail-pg0-f47.google.com with SMTP id r25so8039716pgn.4 for ; Mon, 16 Oct 2017 16:21:37 -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=sV7vJf3CuymuuuifIViwXdwcBHHCUK9AMwKE+9ISANw=; b=Bk3q20+kdYR6yw54+8yv/UHTnod8x89XsmQGVKSP54NGrC6aHR8hqmpDDLEdzvp7rh yeYWD2lBdhY2Pa8FE9RcNe9WVv27NRsG8ovLDrMBkrjC9n/RveFYd9TB3c34gormS2Zj a87Fv71Uc0Ae9ah8f28q1v+jSZFbcUqTtnl0M= 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=sV7vJf3CuymuuuifIViwXdwcBHHCUK9AMwKE+9ISANw=; b=WsQSao0ZQ23CDe6pP1z4XWZKrEXq1smg4hp67ikoXbcWvcN8JvOCstJSeZdmHJtaMn xRA5cSDGx2MFlNkN08JKVqZZw6If9+nIXndyYy8391BgaW/rL2sVtMHfCWVbF8qex4am 6r6ENTmdUENrS1Ujx/uv5pRZf2mTMTHut5DKrpbdXPhcMjw5orwxZWYLyiFQQ6uB9jnS YJbFoi5gkUJj/p7vZ47ZmhU+uph8uCXV7aJQ7tLtkdFjItk8TFYvBwMy/3AxsD27LoBL MJNn6Hn3NYZWf4hL/gasV3q5bNW7HzzUkqa5WcDu/4TWWuY+NJnLnevByPi0tgt9kjuw mdLw== X-Gm-Message-State: AMCzsaV5vqku2K+DEU2G/QJjY+NXZ38lKhkArlBvqr9gJbck3GGxi9gy DAhtsIRL4RnxJjiMvg42/knzNQ== X-Google-Smtp-Source: AOwi7QDzAXpVz7E0ao9c9krWa2h02Zbpxd2B6sIM4DGS9fZmiSyJor742O+aYtN+Vf+Sp7QexHMsTw== X-Received: by 10.84.244.74 with SMTP id e10mr10604694plt.112.1508196097261; Mon, 16 Oct 2017 16:21:37 -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 m185sm15548856pfm.181.2017.10.16.16.21.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2017 16:21:36 -0700 (PDT) Date: Mon, 16 Oct 2017 16:21:35 -0700 From: Kees Cook To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Len Brown , Tony Luck , Borislav Petkov , Tyler Baicar , Will Deacon , James Morse , "Jonathan (Zhixiong) Zhang" , Shiju Jose , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ACPI / APEI: Convert timers to use timer_setup() Message-ID: <20171016232135.GA100431@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.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: "Rafael J. Wysocki" Cc: Len Brown Cc: Tony Luck Cc: Borislav Petkov Cc: Tyler Baicar Cc: Will Deacon Cc: James Morse Cc: "Jonathan (Zhixiong) Zhang" Cc: Shiju Jose Cc: linux-acpi@vger.kernel.org Signed-off-by: Kees Cook Tested-by: Tyler Baicar --- drivers/acpi/apei/ghes.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 3c3a37b8503b..ebaa51ba8a22 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -774,9 +774,9 @@ static void ghes_add_timer(struct ghes *ghes) add_timer(&ghes->timer); } -static void ghes_poll_func(unsigned long data) +static void ghes_poll_func(struct timer_list *t) { - struct ghes *ghes = (void *)data; + struct ghes *ghes = from_timer(ghes, t, timer); ghes_proc(ghes); if (!(ghes->flags & GHES_EXITING)) @@ -1147,8 +1147,7 @@ static int ghes_probe(struct platform_device *ghes_dev) switch (generic->notify.type) { case ACPI_HEST_NOTIFY_POLLED: - setup_deferrable_timer(&ghes->timer, ghes_poll_func, - (unsigned long)ghes); + timer_setup(&ghes->timer, ghes_poll_func, TIMER_DEFERRABLE); ghes_add_timer(ghes); break; case ACPI_HEST_NOTIFY_EXTERNAL: