From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762443AbdJQNst (ORCPT ); Tue, 17 Oct 2017 09:48:49 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58654 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752678AbdJQNsq (ORCPT ); Tue, 17 Oct 2017 09:48:46 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 37FAC6085C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tbaicar@codeaurora.org Subject: Re: [PATCH] ACPI / APEI: Convert timers to use timer_setup() To: Kees Cook , "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Len Brown , Tony Luck , Borislav Petkov , Will Deacon , James Morse , "Jonathan (Zhixiong) Zhang" , Shiju Jose , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20171016232135.GA100431@beast> From: Tyler Baicar Message-ID: <056ca6a5-6612-0794-c6a0-fdebb68e9937@codeaurora.org> Date: Tue, 17 Oct 2017 09:48:32 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171016232135.GA100431@beast> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/16/2017 7:21 PM, Kees Cook wrote: > 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 Verified that the polled error sources still work with this timer setup. Thanks, Tyler > --- > 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: