From patchwork Thu Dec 21 17:33:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghava Aditya Renukunta X-Patchwork-Id: 10128101 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 BBEE860390 for ; Thu, 21 Dec 2017 17:34:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9FD129CE3 for ; Thu, 21 Dec 2017 17:34:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E9C129D1B; Thu, 21 Dec 2017 17:34:56 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI 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 3517229CE3 for ; Thu, 21 Dec 2017 17:34:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754637AbdLURey (ORCPT ); Thu, 21 Dec 2017 12:34:54 -0500 Received: from mail-sn1nam01on0088.outbound.protection.outlook.com ([104.47.32.88]:42624 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753761AbdLUReh (ORCPT ); Thu, 21 Dec 2017 12:34:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mscc365.onmicrosoft.com; s=selector1-microsemi-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=sUkprURyV50+623AL7zh5JIoT2zOMs/iD/gPDQLglQE=; b=j5ab3yvwd2wLg0PJQ8D3+SYY396+TCT99AWGX1YhIx5hI2OrmW3O0nEtVXt0B+8AXBVunEum6TwlgBy+0ZomYwgSh5hqPtpV3/AWY6YVongtIZtcBG5JwjIe6cR0s3F390e5FESqDFW2Iqbw3ltHLEzAOPnUJx7qhes7SdR3R6U= Received: from MWHPR0201CA0065.namprd02.prod.outlook.com (10.167.160.42) by BLUPR0201MB1825.namprd02.prod.outlook.com (10.162.239.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Thu, 21 Dec 2017 17:34:35 +0000 Received: from BN1BFFO11FD012.protection.gbl (2a01:111:f400:7c10::1:173) by MWHPR0201CA0065.outlook.office365.com (2603:10b6:301:73::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.345.14 via Frontend Transport; Thu, 21 Dec 2017 17:34:35 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; linux.vnet.ibm.com; dkim=none (message not signed) header.d=none; linux.vnet.ibm.com; dmarc=bestguesspass action=none header.from=microsemi.com; Received-SPF: Pass (protection.outlook.com: domain of microsemi.com designates 208.19.100.21 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.21; helo=avsrvexchhts1.microsemi.net; Received: from avsrvexchhts1.microsemi.net (208.19.100.21) by BN1BFFO11FD012.mail.protection.outlook.com (10.58.144.75) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.302.6 via Frontend Transport; Thu, 21 Dec 2017 17:34:20 +0000 Received: from localhost (10.181.72.13) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 21 Dec 2017 09:34:22 -0800 From: Raghava Aditya Renukunta To: , , CC: , , , "Guilherme G . Piccoli" Subject: [PATCH 07/29] scsi: aacraid: Refactor reset_host store function Date: Thu, 21 Dec 2017 09:33:58 -0800 Message-ID: <20171221173420.8213-8-RaghavaAditya.Renukunta@microsemi.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20171221173420.8213-1-RaghavaAditya.Renukunta@microsemi.com> References: <20171221173420.8213-1-RaghavaAditya.Renukunta@microsemi.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:208.19.100.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(346002)(376002)(396003)(2980300002)(438002)(199004)(189003)(2950100002)(72206003)(356003)(305945005)(68736007)(8676002)(5660300001)(97736004)(81166006)(106466001)(81156014)(2201001)(6666003)(51416003)(50226002)(53936002)(1076002)(110136005)(8936002)(36756003)(54906003)(69596002)(57986006)(2906002)(48376002)(4326008)(47776003)(86362001)(106002)(77096006)(76506005)(478600001)(316002)(104016004)(76176011)(50466002)(16586007); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0201MB1825; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD012; 1:soOPe2VfZCDF9e7KW9AIjHY7EtOMntsFIhyEAL/Tx4YCjpVA46VbgebnPypHshJwonJDCyZ9dvXD3wlMKZ/2vL2Q6prdYn4lXYo1QK9tbVjtLxTXnSaZAW97L8Cwanfj X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d41deed9-837f-42e9-7a4a-08d5489911f9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4608076)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153060); SRVR:BLUPR0201MB1825; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0201MB1825; 3:eyjA7F0xPGyoCMKSyt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TKoNxHcH2bMKGQSo0g1JnIBYkjQFqmWZAmuMV/uKZlXOQ9YB/PwAckUjY6UUjGfNrZQmPnOd//BSBpQw4ElbP+f8ba8OecrBlq8fUmYD67jwHqbz7tnWkwwPV6fRCSLliwfxc1RsBHZQc16gGJRqSC2az8v9QjCK4/d1Cpkc5JDyddFYD3MepJVpYZjpHdK7XzPWH4tXt7+hlOWlORWYdr6eOHLftEaSTX35C6vjO/+jj6Xbk37TDIMcIlMQ/rLRIeg6nluN8dwZCjU+yJWrFGl+2XxODNPbyt+Ez4gHi0JCxz4OxGbI1Uay9qkXr99gSaRNgemOPW540mx7QGLBuheGVxNcxwNPKT2wvyUVH23+rdbDlaXV7CpdyoCyi/8xaouN06pC5/8B9eSmfBqnNMiAb4tG+dYWpWDVuGiAyjd/GmJYhXhRii3EduYSaySDPc+Mi+W4VI9kc9JP6ehaJWFQ+18pTxsr098bxeS35QCf7or+LXLziEsCf/BhX2NiTRRQGCEAuwVvvBr9/IHbPC+qcQEBLeJq02erY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3002001)(93006095)(93004095)(10201501046)(3231023)(6055026)(6041268)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:BLUPR0201MB1825; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BLUPR0201MB1825; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0201MB1825; 4:80yTEhXCB3l+KW6ST06njZIfX/2BVsDmjmQRSlzui8CYv3li5XgnIA+3JkqtErMCRhMtz57PXv+hSsTCgXauLv+ssJJ+GkxKmdR699Y03r3JeLRXNaMm96zaXAoZmwtYOesBnKuVEXpkzJ33r1EYVBZFfxmLme9GM3bhEakVlLfI5DZboltCXU4nuBxc5DX6ZtP1hJRPNbxoT1+d3eoLA+o4JJQAKvFFK8AfrrNHQCNDx5fEuUmsLpfU9e0zNQRnYYfhOMaSGiyEmOUnWOz9CJD8/TcnvgMwItHOCtx2q/+SSh4UQ7VjNfW+3eMi7DvD X-Forefront-PRVS: 0528942FD8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0201MB1825; 23:72k6tAmTmJjnKqWynVJ+HADIXzDUIas+GNwhj81?= =?us-ascii?Q?9fXLhurknTXuYgGhUvvHsXmrnowE1GAGwu93mRWEbIiiHMwhRESxv2QVUcvq?= =?us-ascii?Q?QJTbnZH0qX967DpaYkrXw38IHDKGTQJIgZU2WYW/yZF2dKy/jsHz2e2Dzo4g?= =?us-ascii?Q?pSdlnauJUMCIajyww4iC9h9VEw+tAvD0I6lr1okIN8QwsKrk7jpRvIS6E/hQ?= =?us-ascii?Q?eZgvXhCJMU/XZq5EW6GgQpd4k0jKC2Udsst++YC43rehvYtVqZMS+vP5VGcB?= =?us-ascii?Q?7hp/dHb89nSBASI+jG/HQuTnuuU11pvPh3NP9hHHVBFwMNFAL6Q/v9tsY0ya?= =?us-ascii?Q?xSJF38guRUefUuKKRj6SxYrT8B7KIb+g9izdrTbK+rzokB15hRj3kaYqv0Fw?= =?us-ascii?Q?vPYZTDIp5RcHF4Uu56KY4WZHTYFQ2i8WczSHs5/LC0o1/7q+5hpFy7xljYrW?= =?us-ascii?Q?NG3rDCUqwBY3hDxZw7v33DSfvLGZERvM65f5GFX0jDoNHUNVwmNHuowXfFAC?= =?us-ascii?Q?LWDLkocKbjZoNmgv9SfECs6R//QoSoRRv/mrncuytDbRVGNumcWNmZNseR4A?= =?us-ascii?Q?f2RJUFKgg813RzGzJoTF8ap3EEUbNoIF9QfQBwjDVgkGvm4awXo2cA7aNs0Y?= =?us-ascii?Q?/8FxX9xgd3gqrcPXBYPESNjIbrQS/mVHFemCFbKszhBu3jLMl99RyKdKDzda?= =?us-ascii?Q?tSIDte/NKZzrFsFVXzKvI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jImF91shqb+0UxdFCbQ1qVt2w2edK3JR7KJo0Anq7M51VW2hqNJf4+y9Ycg1YDvJSE4HulJugcyUsUopupYhc=; 7:738CtB8bip5cmB+pbNs7FjmvvibpjQnCaeLHW2G8jzmw6GL1+Pg4caYkQXhBxcsAvR0wB1sAS+T/Nesk0NXCfGz5XG4E0r91DisO5Ab8PHnvOiaU/iP2rCXwYwyF43bLyzd2oFighKPM1Rof+GUW6PfbzlKzGioavUOfFfK37pQGtUXc/gWzvn/y8fvQff4EY2Q43K5pw5iaEpdQ2Nc9iu2TFqKfTekysJRvUpsa/Z+JQtXdL2sF7ffpFmu00cSn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2017 17:34:20.8119 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d41deed9-837f-42e9-7a4a-08d5489911f9 X-MS-Exchange-CrossTenant-Id: f267a5c8-86d8-4cc9-af71-1fd2c67c8fad X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f267a5c8-86d8-4cc9-af71-1fd2c67c8fad; Ip=[208.19.100.21]; Helo=[avsrvexchhts1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0201MB1825 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Refactored the reset_host store function to make consistent across code bases. Signed-off-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/linit.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 5eb0722..b2273e3 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -1375,18 +1375,15 @@ static ssize_t aac_store_reset_adapter(struct device *device, const char *buf, size_t count) { int retval = -EACCES; - int bled = 0; - struct aac_dev *aac; - if (!capable(CAP_SYS_ADMIN)) return retval; - aac = (struct aac_dev *)class_to_shost(device)->hostdata; - bled = buf[0] == '!' ? 1:0; - retval = aac_reset_adapter(aac, bled, IOP_HWSOFT_RESET); + retval = aac_reset_adapter(shost_priv(class_to_shost(device)), + buf[0] == '!', IOP_HWSOFT_RESET); if (retval >= 0) retval = count; + return retval; }