From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932580AbdJXK0m (ORCPT ); Tue, 24 Oct 2017 06:26:42 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:50807 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932304AbdJXK0j (ORCPT ); Tue, 24 Oct 2017 06:26:39 -0400 X-Google-Smtp-Source: ABhQp+RZzbE3SZrBnHKE93DGDYKd/5peHFngDhS41vyfooXU549t/N4ewv1J1GHWczoYrNijoQBZNA== Date: Tue, 24 Oct 2017 03:26:36 -0700 From: Kees Cook To: Borislav Petkov Cc: Thomas Gleixner , Christophe JAILLET , Nicolas Iooss , Ingo Molnar , linux-kernel@vger.kernel.org Subject: [PATCH] RAS/CEC: Convert timers to use timer_setup() Message-ID: <20171024102636.GA69779@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Borislav Petkov Cc: Thomas Gleixner Cc: Christophe JAILLET Cc: Nicolas Iooss Cc: Ingo Molnar Signed-off-by: Kees Cook --- drivers/ras/cec.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c index e2c1988cd7c0..fb2789575603 100644 --- a/drivers/ras/cec.c +++ b/drivers/ras/cec.c @@ -168,11 +168,9 @@ static void cec_mod_timer(struct timer_list *t, unsigned long interval) mod_timer(t, round_jiffies(iv)); } -static void cec_timer_fn(unsigned long data) +static void cec_timer_fn(struct timer_list *unused) { - struct ce_array *ca = (struct ce_array *)data; - - do_spring_cleaning(ca); + do_spring_cleaning(&ce_arr); cec_mod_timer(&cec_timer, timer_interval); } @@ -509,7 +507,7 @@ void __init cec_init(void) if (create_debugfs_nodes()) return; - setup_timer(&cec_timer, cec_timer_fn, (unsigned long)&ce_arr); + timer_setup(&cec_timer, cec_timer_fn, 0); cec_mod_timer(&cec_timer, CEC_TIMER_DEFAULT_INTERVAL); pr_info("Correctable Errors collector initialized.\n"); -- 2.7.4 -- Kees Cook Pixel Security