From patchwork Wed Dec 27 04:34:28 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: 10133391 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 403AC602BD for ; Wed, 27 Dec 2017 04:35:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 294AF2DA5C for ; Wed, 27 Dec 2017 04:35:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DF8A2DA5E; Wed, 27 Dec 2017 04:35:13 +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 012752DA56 for ; Wed, 27 Dec 2017 04:35:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751800AbdL0EfK (ORCPT ); Tue, 26 Dec 2017 23:35:10 -0500 Received: from mail-dm3nam03on0055.outbound.protection.outlook.com ([104.47.41.55]:25600 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751495AbdL0EfG (ORCPT ); Tue, 26 Dec 2017 23:35:06 -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=UMyXPafnHcz1EiLlSaOZKk1EUvF8VwUm9+gthk2m4Rg=; b=OofkDZl3+Di9U7hmSpC6cJAqWRoVZtwCKL/AYClIyjT//0HkOqGsc5aGTCxW058sWqWYQMwuwhLWEG/h05waaPSWwgIUvLefrugM2q2CDhidogAHgOTf4dNW5Cazm3/1JWcCEY0TEPkVdcnzsuyMNislw1ZceibGOR1sGG32pXE= Received: from CY4PR02CA0002.namprd02.prod.outlook.com (10.169.188.12) by SN1PR0201MB1838.namprd02.prod.outlook.com (10.162.228.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Wed, 27 Dec 2017 04:35:03 +0000 Received: from BL2FFO11FD049.protection.gbl (2a01:111:f400:7c09::182) by CY4PR02CA0002.outlook.office365.com (2603:10b6:903:18::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.366.8 via Frontend Transport; Wed, 27 Dec 2017 04:35:03 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.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 BL2FFO11FD049.mail.protection.outlook.com (10.173.161.211) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.345.12 via Frontend Transport; Wed, 27 Dec 2017 04:34:43 +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; Tue, 26 Dec 2017 20:34:54 -0800 From: Raghava Aditya Renukunta To: , , CC: , , , "Guilherme G . Piccoli" , Bart Van Assche Subject: [PATCH v2 07/30] scsi: aacraid: Refactor reset_host store function Date: Tue, 26 Dec 2017 20:34:28 -0800 Message-ID: <20171227043451.27813-8-RaghavaAditya.Renukunta@microsemi.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20171227043451.27813-1-RaghavaAditya.Renukunta@microsemi.com> References: <20171227043451.27813-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)(396003)(39380400002)(346002)(376002)(39860400002)(2980300002)(438002)(199004)(189003)(16586007)(36756003)(104016004)(4326008)(106466001)(50226002)(2201001)(53936002)(1076002)(316002)(97736004)(76176011)(86362001)(48376002)(50466002)(51416003)(72206003)(2906002)(77096006)(47776003)(81166006)(81156014)(8936002)(8676002)(54906003)(110136005)(106002)(76506005)(305945005)(356003)(69596002)(2950100002)(478600001)(5660300001)(57986006)(68736007)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0201MB1838; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD049; 1:9PfzR/9ca840YfuADDn1c9Q//DVOCvK3VwM9UnpGRh442Yw1/q3/Zfk/e9kLZ+j5RGHYw5Y2zN29FjkgQ9ugYDoKk9htwV56XDaKtGA8L9DS6sdsFvxhA5W3PkJzdzkW X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fd2e4f0e-7ff4-4fc0-f997-08d54ce32746 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(4608076)(2017052603307)(7153060); SRVR:SN1PR0201MB1838; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0201MB1838; 3:bsfkrUiZ6PQch3BGdc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K/kV2E9hHrP8TKOWTDLOlBLrQR/RS4m0PcIfD922mmDds/q3whlXQEu5VUlwUzkON2lVgSCqzyzchdDSdxb5NoL7vBi7J/6yfgj3b+trRqK9GU5AwPojYwqeJLsaG+Yphsj+Ou9OhZFkr9TAkcil/4h9R1V0skRZg4JuhdWyj/jNRCSZ1HGpYq+r+qew980OhgVSv0lBtpWa4OUSfunxwfzb7AT3smzlG3LPlkxM1GJjPD3lUGxD6TRqp3/jD81v2zia/C6ed6TbxPdXU/GnESK4vwEdGNwJs9/aHmlqE8Z0PE/bDQsErWaux8/K20bS0Od0OMasW+cZ9Q1HrE9tVn49KD8ep19gNzgrEx/NLugZj1ckuNNGXH92zp0FMHuJFCtBgx+hdyndalstrNK2dcnr7rkwnS+U9lqzcQZfigkmfHlzO9d8wds2I/xLM55x2q1DoLocBllkp0hIW96wrOm/DdF54DSL2E04wfGYXF2XbPWnI7qCSFO287W4LAur2QxI5/jDr4Ya8CO0JHC+FFastnC+lkTCrOkCEFBSZaw= 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)(3231023)(944501075)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041268)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:SN1PR0201MB1838; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN1PR0201MB1838; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0201MB1838; 4:dxADlKwd4g6kXA2fSzXNbI78Re0+InybubLtks6r+GaQBuCAintTr8tff4qy9TX8dOAHMca+DWMMdeco/AF4TzpQkM5bSkwIgpfHV7dT7/AzdMx7MmvHndNlpMyDQ2RV+XHcY0J9X2PeU3ZPH/Qf0tejeeddsD+M0SSDHOlJol1MMS6oSk+TgJ3SkOdSCXRKMzxnBMnd1aB7ooXeDVbnw3/guT6HLayPHRFq8U3B+bCQ5cTsn1TcpMsqj7r2V2g6/pVP8CPThpMXleW49EC+maIj3GVbma+tq4ggcR+3oIVjBAs+/87e+w1BsWvvVzkc X-Forefront-PRVS: 0534947130 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0201MB1838; 23:5MXE672rL9CLI0U11iuPCo/T3wIZRMWlFHnVZKG?= =?us-ascii?Q?X4esm3c/d4YsVKRuLp6J6hbOBzTFJhpgbWyXuZ5Kq012BGh7ZfakYG387O+7?= =?us-ascii?Q?wMOwo9kDsM9qmq1plVKN7KG1XBvYRw5D2Zp3hoC8HpALpQR9+Y4DSiJXEIZF?= =?us-ascii?Q?LdWIJQhLsc6CueO6fhBgIOP0UXgg9T/bj9zgF3c25E/zllpHTFy8M76aT/1O?= =?us-ascii?Q?/NXYr/6EYfkpkXyNDllI3r7i/MFrG01OW1Mat6EOaLIWHnymdYQDZMqodWVB?= =?us-ascii?Q?8qMuR5RD3D3kMlHodbSsCLvWo7fzQFXhokb1ecUEyM6ZuFQ6bV5eIMd8iLMs?= =?us-ascii?Q?dG8t6tdLar9U8myX/FaPqPDlk6tM2kA1vdwATSY2waIjZzssS3qjCyy9yeEI?= =?us-ascii?Q?8gLRRubdfDxDIIQVbCY0Mv3m5NEsmpc4VT+ZVm9w7FIOz7Zyx0TdCif0Gaib?= =?us-ascii?Q?O2QB86vFSCTBTjuhwDbgPlh88u9IMCZeWoKxyl1VwnWEIO/02P0DI9IQMIdd?= =?us-ascii?Q?b/Ra725rCnDrLwnKD4Qe+ADvnMv6gqgeQBWAGLhW+I+OYGDRuknaE9vy0cPE?= =?us-ascii?Q?LVKcCVPttkKS98L2OAsFwTFRtwSzGTpX0etBv2iEQSZetcxjSQAjM/6lwqW9?= =?us-ascii?Q?3+TYw5ECGc30/qhok1FKBuHxM4OzJP/r6SZ3U+yzgakS0JjsOdUzpwJFCgie?= =?us-ascii?Q?fnMYb/G3f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A8YiT9x2MtnNnYdFLXmh0O/CxxkyRLvwFhQTSxetgc/6nZxDiTwbPWf9g8s7Bc0dzWI4CqqnKOC4b29Wg=; 7:M7kZK7QjS+2qTbT2eUqCq4O9fB0S5N4zDHIPBk8UtATlsgdh3NAQ4AvLGp5+EhTO2SM1jBXYTmhc5m2OueUa9khWdnAqmnXMhjMSLjYZ3x55Hf+T7VE+kAySn+vQtwnbA0xfiNysFb10JBbo91siBq4K3M5Xiuz/OXY3qqnX1jOExyfUiBU7YdYubHKrx+T5uSrNuf6PawVbveLAIPKjbR61YH2KHuK8VPUEgd3ymicwfS0LWbzlOJi7wfu/huWo SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2017 04:34:43.7895 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fd2e4f0e-7ff4-4fc0-f997-08d54ce32746 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: SN1PR0201MB1838 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 --- Changes in V2: None 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; }