From patchwork Tue Jan 16 03:46:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Hart X-Patchwork-Id: 10165847 X-Patchwork-Delegate: dvhart@infradead.org 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 CA2A960245 for ; Tue, 16 Jan 2018 03:46:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB084206E2 for ; Tue, 16 Jan 2018 03:46:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EE6522B26; Tue, 16 Jan 2018 03:46:22 +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=unavailable 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 3F5F0206E2 for ; Tue, 16 Jan 2018 03:46:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751620AbeAPDqL (ORCPT ); Mon, 15 Jan 2018 22:46:11 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:42894 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601AbeAPDqJ (ORCPT ); Mon, 15 Jan 2018 22:46:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GjW5ATRw1ogIjgoaPRFF2948nR+ozMDMAHNxeoC7ysY=; b=LzPIhr3/HEKbcUpIRj94k3gZd NeRVzBT9/1Cu24oX35W/6cJVAvI6bfSdXR4Xyw+JPkenjDtqEWedgwku4yv0zymY6jvLTLRz5lgtd in/h1sdRCX/+wT7b/81IS7YxWB2u1seMa376B9SmRxiREvBzdO0a3PvXkzs898q4vk0fQck/gcjpg n3m2VntnrPg52mlSscjFnXP5FzNluY9n2y0LKcf0XVujdNMqmu2kGdkHpyekBAAdu8x6IG4eF5Uny 31Bc02njnCm53BZRnxTGNAjdHEk3xy4mFuvFfXlEZ9NAYtYIq9qrf49vQLFfpxRp3XscBM7kWbn5o 2ijfdymGA==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1ebICN-0008DE-Sd; Tue, 16 Jan 2018 03:46:07 +0000 Date: Mon, 15 Jan 2018 19:46:06 -0800 From: Darren Hart To: Vadim Pasternak Cc: andy.shevchenko@gmail.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, jiri@resnulli.us Subject: Re: [patch v8 0/3] drivers/platform: replace module x86/mlxcpld-hotplug with mellanox/mlxreg-hotplug Message-ID: <20180116034606.GF4590@fury> References: <1515661123-76604-1-git-send-email-vadimp@mellanox.com> <20180116034209.GA4590@fury> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180116034209.GA4590@fury> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Jan 15, 2018 at 07:42:09PM -0800, Darren Hart wrote: > To follow this email, are two patches which are minor incremental > cleanups, which I'd appreciate your review of before I push them to > testing. From ccfc9b138034b5ccd89da1d938e9241eaeb4dabf Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: <2c5d26ee913e0f5f7d13c559d85e8da7e4ddcdab.1516073719.git.dvhart@infradead.org> References: <2c5d26ee913e0f5f7d13c559d85e8da7e4ddcdab.1516073719.git.dvhart@infradead.org> From: "Darren Hart (VMware)" Date: Mon, 15 Jan 2018 19:28:10 -0800 Subject: [PATCH 2/2] platform/mellanox: mlxreg-hotplug: Cleanup local variable declarations Make the local variable declarations more consistent throughout the driver. Separate inline initial assignments when it cleans up the declaration block. Signed-off-by: Darren Hart (VMware) Cc: Vadim Pasternak --- drivers/platform/mellanox/mlxreg-hotplug.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c index 78056f7..7cf7c17 100644 --- a/drivers/platform/mellanox/mlxreg-hotplug.c +++ b/drivers/platform/mellanox/mlxreg-hotplug.c @@ -361,17 +361,18 @@ mlxreg_hotplug_health_work_helper(struct mlxreg_hotplug_priv_data *priv, */ static void mlxreg_hotplug_work_handler(struct work_struct *work) { - struct mlxreg_hotplug_priv_data *priv = container_of(work, - struct mlxreg_hotplug_priv_data, dwork_irq.work); struct mlxreg_core_hotplug_platform_data *pdata; + struct mlxreg_hotplug_priv_data *priv; struct mlxreg_core_item *item; - unsigned long flags; u32 regval, aggr_asserted; - int i; - int ret; + unsigned long flags; + int i, ret; + priv = container_of(work, struct mlxreg_hotplug_priv_data, + dwork_irq.work); pdata = dev_get_platdata(&priv->pdev->dev); item = pdata->items; + /* Mask aggregation event. */ ret = regmap_write(priv->regmap, pdata->cell + MLXREG_HOTPLUG_AGGR_MASK_OFF, 0); @@ -431,8 +432,7 @@ static int mlxreg_hotplug_set_irq(struct mlxreg_hotplug_priv_data *priv) { struct mlxreg_core_hotplug_platform_data *pdata; struct mlxreg_core_item *item; - int i; - int ret; + int i, ret; pdata = dev_get_platdata(&priv->pdev->dev); item = pdata->items; @@ -520,8 +520,9 @@ static void mlxreg_hotplug_unset_irq(struct mlxreg_hotplug_priv_data *priv) static irqreturn_t mlxreg_hotplug_irq_handler(int irq, void *dev) { - struct mlxreg_hotplug_priv_data *priv = - (struct mlxreg_hotplug_priv_data *)dev; + struct mlxreg_hotplug_priv_data *priv; + + priv = (struct mlxreg_hotplug_priv_data *)dev; /* Schedule work task for immediate execution.*/ schedule_delayed_work(&priv->dwork_irq, 0);