From patchwork Fri Oct 27 05:55:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10029135 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 99E6F60249 for ; Fri, 27 Oct 2017 05:55:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C8F428F3F for ; Fri, 27 Oct 2017 05:55:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80E9028F41; Fri, 27 Oct 2017 05:55:30 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 08F7128F3F for ; Fri, 27 Oct 2017 05:55:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751834AbdJ0FzY (ORCPT ); Fri, 27 Oct 2017 01:55:24 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:50255 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752022AbdJ0FzX (ORCPT ); Fri, 27 Oct 2017 01:55:23 -0400 Received: by mail-pg0-f65.google.com with SMTP id y5so4511891pgq.7 for ; Thu, 26 Oct 2017 22:55:22 -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=5gMzAMsdw7cY8B97kTwVGT5SOhJ6ESJsn4X1U8dFkgc=; b=IV4SOZcP3whFgmf6jdTsE4x2Go8+OlRekk/pdCoViXuVHsScejFWWM3t6Y5jAHq+Tu Nxf9nUUNJDeVEdiHqnjH0+wp6Iq63A8zH/R7v7rZj3lqRM8KjAQdKEwlgPPAC/uQ/q5k NWgk6ur+lZZmqO3XFg+I2KH9MbD00NVKnQBaQ= 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=5gMzAMsdw7cY8B97kTwVGT5SOhJ6ESJsn4X1U8dFkgc=; b=DAQoYIOBt+SsfQzILjM5IgVvoQCM9NgALmTFugJGHiw0Z4db9NCTRamG7grlj2wRqw 88cxJoBFvhr8H46TI8LXyj8c8U00ip+Tjai20MA20eRhlDaRQYCcox5aXR1XcNGp2958 9+sMik9N/X1d1LJ/KMGjdQ1LcIzu89iEh8viOhBxWroJ9L4wdCxFugA02adiIHtPVuAU sI85VCmkSd1P6ViJHEeT7hYOIIkeWoeOv/e0424m4E+rYGyGNrAmRqmesAKcSnVvClYA mHTTFTg8cjTey24at6Rj0rPfeiTwNlz8UDWsWtdTzixTN9j3fM6YGR4wbzzhxUNTAB4x Dcug== X-Gm-Message-State: AMCzsaWVSyjVSx6i2jNsCD8poRKeNPxAuvZ5J9pBDu6QlNOtMChM5EBw l9t0503/n+G4xdlJEwkjbdgAyg== X-Google-Smtp-Source: ABhQp+TKuWJ2ELuiicAo/2PzrUgh3pSYZ4g5dXJAItYJOmqqBPVyI5qVInvLv4+PjskapIIOd+4sOw== X-Received: by 10.159.242.1 with SMTP id t1mr247872plr.411.1509083722551; Thu, 26 Oct 2017 22:55:22 -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 c8sm12522538pfm.47.2017.10.26.22.55.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 22:55:21 -0700 (PDT) Date: Thu, 26 Oct 2017 22:55:20 -0700 From: Kees Cook To: "David S. Miller" Cc: Saeed Mahameed , Matan Barak , Leon Romanovsky , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers/net: mellanox: Convert timers to use timer_setup() Message-ID: <20171027055520.GA118469@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@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: Saeed Mahameed Cc: Matan Barak Cc: Leon Romanovsky Cc: netdev@vger.kernel.org Cc: linux-rdma@vger.kernel.org Signed-off-by: Kees Cook --- drivers/net/ethernet/mellanox/mlx5/core/health.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net/ethernet/mellanox/mlx5/core/health.c index a89a68ce53ad..185dcac0abe7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/health.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c @@ -285,9 +285,9 @@ void mlx5_trigger_health_work(struct mlx5_core_dev *dev) spin_unlock_irqrestore(&health->wq_lock, flags); } -static void poll_health(unsigned long data) +static void poll_health(struct timer_list *t) { - struct mlx5_core_dev *dev = (struct mlx5_core_dev *)data; + struct mlx5_core_dev *dev = from_timer(dev, t, priv.health.timer); struct mlx5_core_health *health = &dev->priv.health; u32 count; @@ -320,7 +320,7 @@ void mlx5_start_health_poll(struct mlx5_core_dev *dev) { struct mlx5_core_health *health = &dev->priv.health; - setup_timer(&health->timer, poll_health, (unsigned long)dev); + timer_setup(&health->timer, poll_health, 0); health->sick = 0; clear_bit(MLX5_DROP_NEW_HEALTH_WORK, &health->flags); clear_bit(MLX5_DROP_NEW_RECOVERY_WORK, &health->flags);