From patchwork Thu Nov 2 23:11:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 833567 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="EckNVeBO"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3ySgp22LqLz9s5L for ; Fri, 3 Nov 2017 10:11:54 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934374AbdKBXLw (ORCPT ); Thu, 2 Nov 2017 19:11:52 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:54557 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932343AbdKBXLv (ORCPT ); Thu, 2 Nov 2017 19:11:51 -0400 Received: by mail-pg0-f65.google.com with SMTP id l24so901559pgu.11 for ; Thu, 02 Nov 2017 16:11:51 -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=Td5wX3Z2URT8i2+RB14VYSbnBJmrqVvmMEf0bil55og=; b=EckNVeBOybgt1dYFRYyt/IxbrJUD+Q8TFP337Sr83QakYBRUopxPyYUE5jVC0c1XzS WZQ/3IZQqiXRwFJ2Lwrm0H92obpHxgyZgtrjPXNy7Ptz4IxBCgTzIXX5EUntOIdo6XXa h6/2f6mz/bGpf4lULcidwINHbxPkKnZxYww2Y= 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=Td5wX3Z2URT8i2+RB14VYSbnBJmrqVvmMEf0bil55og=; b=dGppDYJZRYeKGXK6IPxF22CMCASFHbwfMI9d/e3G9vTR/5EozTS3s/rzPqRqZoucTD A+gfdTlZkfX9J3NMwsHLHdQsx9V1ZbOf7OPaB6FUMLe9LhXO5sOekRM6bomxS8khlvM9 WR5DiRVIPegi8g0EDLsWhec3w7DBSDCY6PujdGQrjoebS0I3v3HMDPj1CY1g8K+FoKNw L5E2K6eL+ksH8bcRtjo4BLBZ8hY4aIa9Evge7iwHh71y9xuBmQoslv4IxlQUgG5YVx2N y7oqm/zBreZRx8VAWOiEaePtOe4kO+tcdrQ0kQIhRtbkwnGo894Y7bVjDVfp/cuxGNyk Iesw== X-Gm-Message-State: AMCzsaXTxVX9R9DfseLqNNlDXHSpz325cwTqtV05KYNmRl7igG4BEIyp bXZcHwXW9dbxcsL4at+hzSMrQg== X-Google-Smtp-Source: ABhQp+Rr/fvXI0G+o5Hxqlducip/AGvttNDzQzf2S1pxdaxjjGvC3Nfm/mAy6rt6E33twbPNaUV3SA== X-Received: by 10.84.235.69 with SMTP id g5mr4991857plt.239.1509664311054; Thu, 02 Nov 2017 16:11:51 -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 h67sm9942648pfk.60.2017.11.02.16.11.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Nov 2017 16:11:49 -0700 (PDT) Date: Thu, 2 Nov 2017 16:11:48 -0700 From: Kees Cook To: "David S. Miller" Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org Subject: [PATCH] ide: Convert timers to use timer_setup() Message-ID: <20171102231148.GA100210@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@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: "David S. Miller" Cc: linux-ide@vger.kernel.org Signed-off-by: Kees Cook --- drivers/ide/ide-io.c | 4 ++-- drivers/ide/ide-probe.c | 2 +- include/linux/ide.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 3a234701d92c..6f25da56a169 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -611,9 +611,9 @@ static int drive_is_ready(ide_drive_t *drive) * logic that wants cleaning up. */ -void ide_timer_expiry (unsigned long data) +void ide_timer_expiry(struct timer_list *t) { - ide_hwif_t *hwif = (ide_hwif_t *)data; + ide_hwif_t *hwif = from_timer(hwif, t, timer); ide_drive_t *uninitialized_var(drive); ide_handler_t *handler; unsigned long flags; diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index eaf39e5db08b..17fd55af4d92 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -1184,7 +1184,7 @@ static void ide_init_port_data(ide_hwif_t *hwif, unsigned int index) spin_lock_init(&hwif->lock); - setup_timer(&hwif->timer, &ide_timer_expiry, (unsigned long)hwif); + timer_setup(&hwif->timer, ide_timer_expiry, 0); init_completion(&hwif->gendev_rel_comp); diff --git a/include/linux/ide.h b/include/linux/ide.h index dc152e4b7f73..cc412175d036 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1211,7 +1211,7 @@ extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout); extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout); -extern void ide_timer_expiry(unsigned long); +extern void ide_timer_expiry(struct timer_list *t); extern irqreturn_t ide_intr(int irq, void *dev_id); extern void do_ide_request(struct request_queue *); extern void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq);