From patchwork Wed Oct 14 08:46:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tang yuantian X-Patchwork-Id: 7391451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 32F7BBEEA4 for ; Wed, 14 Oct 2015 08:56:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BB73D20662 for ; Wed, 14 Oct 2015 08:56:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DEB0D20502 for ; Wed, 14 Oct 2015 08:56:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZmHof-0005Gh-1H; Wed, 14 Oct 2015 08:53:45 +0000 Received: from mail-bl2on0141.outbound.protection.outlook.com ([65.55.169.141] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZmHoa-00057w-J5 for linux-arm-kernel@lists.infradead.org; Wed, 14 Oct 2015 08:53:42 +0000 Received: from DM2PR03CA0027.namprd03.prod.outlook.com (10.141.96.26) by BL2PR03MB562.namprd03.prod.outlook.com (10.141.91.27) with Microsoft SMTP Server (TLS) id 15.1.293.16; Wed, 14 Oct 2015 08:53:18 +0000 Received: from BY2FFO11FD044.protection.gbl (2a01:111:f400:7c0c::175) by DM2PR03CA0027.outlook.office365.com (2a01:111:e400:2428::26) with Microsoft SMTP Server (TLS) id 15.1.300.14 via Frontend Transport; Wed, 14 Oct 2015 08:53:17 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; arndb.de; dkim=none (message not signed) header.d=none; arndb.de; dmarc=none action=none header.from=freescale.com; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD044.mail.protection.outlook.com (10.1.14.229) with Microsoft SMTP Server (TLS) id 15.1.293.9 via Frontend Transport; Wed, 14 Oct 2015 08:53:17 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t9E8rDAQ023378; Wed, 14 Oct 2015 01:53:14 -0700 From: Tang Yuantian To: Subject: [PATCH] ahci: qoriq: Fix a compiling warning Date: Wed, 14 Oct 2015 16:46:52 +0800 Message-ID: <1444812412-33321-1-git-send-email-Yuantian.Tang@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD044; 1:nSSIpdZVCWVGu5BAxU2lz3ye7JhryU+9oQ5V0WmObNWAdXnILzKZaSnCcDwGxBB8NgpW4nKkAwnrruZ5/koqC65jCtrsvZu8bxYxavTuX/6sS0S9NSES6S8WGUhnjfhten/wt6JZW+z90UpFL9xHjTpcGR8lHzt1Xhzl77AXgeicomY1Ud6tSGJc2dT0DmnD+QPsaVH1otfvjR3JepRII9EMULyVhYUXN8RUKs9ZRcdupycDf1y8XZeZg7+H5FGsqN6oaWLoD+J5mpr2rYaRRdGbompMqJuM12WfOj//AwqbZHT+P51kgl0JRu/cQCeXoBo5AZnrUd0Ew1C1VrxVRGmOgSg6r9gopT34cpcvwZI99rbuFdX0SRndAt7qvBNpp+HmfyKNNQOV+fDqrgTpfw== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(50226001)(105606002)(77096005)(36756003)(5001960100002)(64706001)(87936001)(81156007)(5007970100001)(97736004)(11100500001)(47776003)(50466002)(104016004)(5003940100001)(19580405001)(19580395003)(6806005)(92566002)(189998001)(5001920100001)(229853001)(69596002)(106466001)(50986999)(86362001)(5008740100001)(48376002)(110136002)(46102003)(2351001)(85426001); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR03MB562; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB562; 2:bR+TJhMiSNFuDw40sLI1AfeQWbJ67FwPwZBdF9IrrsL+52x7wfxbp/JraZ92Y+EnOVCY0fcS1L9zJgi61ggbdAkbTpAuFhgHVibbQw17mXOqXthuNYC33m7ObQlfMWigzmuQMvXhtYh7ZJVXNZs4oCrsGVeFywL5w6QsHnMqZRk=; 3:o0LBX5sTRmp7j4Oa3WyBl6KnlBl9c7Vucjx0yAcEI7Dad//Iomc3/yJ0bA09KNOJ2GtJvFDm1FCIHe0fUxLHoAfbp+0g8e+mL5o/8dIT2AmTaG5xVqojrXpz7n4v4OL/Iz6nBC1RtBNmx0lUHEBQg6L1GE+fPzgzBWSXQqJzcW8ngub/nPNIpEWKdb3cBmeUezX2eT3wBXFjsw75VbIXFWB4uf9ck3JR6ZueNWzqwig=; 25:oOxT4iWd243mWvlw8x4HOCTVn2QqnzbXz9EHn2MZk9WM8qaGGQmBiHUyJoSvmGjQIC6oj2oElmYCaMzIfwQLuxJ8lt/0oftMH011SYJU8k9nMoxJ9nrzA1+/1qBErKyXBuvjyYsEntM9rJv//blZEhhCMMudcU2Iy/MI1mcLHirVtQDJKm4oi0Wt7AsTXmPQ6owVjyGFxmMdhBQl+wrmIYCsR70AbgOMobdoM3tZbgZqfcKnXutUgNFubgRv7/nFtr8aOkwS3wUAhB+7GRr1HA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB562; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB562; 20:IzKDMMgsTvbJl462hOFlzltatGrcjSvtNeECojAQKhb22HWWEK6K2mqvLbJDSqYJiHPXQSl6LSpSrAx71P3V0cE1nsVUrG4Pl+XhxoLNvN+Xbv8RbEpbTZOEeHEYtIoJIBkLcMkUio6fxR+4Ak63l803fEwqOEIGEbJob8gwVoEkR0CCMlrJ0iBn5lv4XJs3gp6hqh6QIVhaCsRPnMqLgnmIJRZC8HjrMgxQ4eheGjIkzBkmJMpO4WxBiHQCVg43l9uxIReoFMjyUjPdUD1j5rlBp8iWTB6AmP2SpQlDCR90jbpBi2GTcdJ7tloOu1WQO2jR65IWAbxz7uLESag/gv3WN2n2ooak3JOXCLBac7Q=; 4:EszQEKg+UqwvJKxR1fzaal/AfbY70lDQPws8zzp3h936x2P/xJxWRChHlN/OeJ8jy79XZrmklImf8hKuHqA9fF2VNnz25nn9Z4hF4F0E7TXdVzkiax1g1VmHAhBO77MPF4nB27q7K2s0RINIbt67VT6jBURetSEh8ac0uTWVM6GG39QF/A9gsgXx+wkh63Es7B9OHB/cKQCBMTrIvKMSAkrVRBveOASS6aOnA2wrGFSCAlF421QN/645kYxNBEZcFwndNt1gWxAq7a2aaDzWMZiab3d6CE5RcTTHlEWoHD3MAI/shLW1aEV0Q/snbw2ogegoIYoLFDQ9lBby2c3k8CYpR1WpgFM0/ANENNFPoTI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001); SRVR:BL2PR03MB562; BCL:0; PCL:0; RULEID:; SRVR:BL2PR03MB562; X-Forefront-PRVS: 0729050452 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR03MB562; 23:NYLkOlOTC5vh1Bqh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q?h1+i/swI2RSV4Ii+MNeplOwSSj/ElLoXV4+pO/l0bxlyXiuxvi08xuNKqMp/?= =?us-ascii?Q?bw/sil2mwC6Wg/lxT44ri+OyKB7bKsZ/XsY9hbKknDx9/Qi+enCeFXqGFN2E?= =?us-ascii?Q?se1eCV0SiLItdqS7/Uhw5o9oKYfgij6eBpEXkwqPrUqP6rvS/rf0KPH7R3oR?= =?us-ascii?Q?QVHFs=3D?= X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB562; 5:F/O7znwfkAcn/N3Hk8blbPd6BNyB9Qn1AHOej1Az57LTL1g159w1hdSX4asGURDmpW9ZqbJZlHawyaIGKS1yx6edqUdqa6eqScZbGIiXgyyErfpQr49ipNz1hd4ChKSFwBRs+YTpc34JCehEf2WM7Q==; 24:1aM7j9q+5ExPEl9UsZDkPq/bILOikNHdJkCnnisVGTGe6ynWUJXiqYHvCkV1UQM4zWHSqQHJ2M8ewiWKZjpVdsZdnJsTzKyCubtJb2uK4k8=; 20:Z0j1rvegmx/wx4mHf0HyVLkKj+JqNwzMNslByJ3FVRr4VR74tP0qWEMChD/3P2H459hROwRVL4c/PU3Wqsc+hQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2015 08:53:17.1551 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB562 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151014_015340_958694_554BD35B X-CRM114-Status: GOOD ( 16.37 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Tang Yuantian , linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, tj@kernel.org, fengguang.wu@intel.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP kbuild test robot reports the warnings: drivers/ata/ahci_qoriq.c: In function 'ahci_qoriq_hardreset': >> include/asm-generic/io.h:163:2: warning: 'px_is' may be used >> uninitialized in this function [-Wuninitialized] drivers/ata/ahci_qoriq.c:70:14: note: 'px_is' was declared here >> include/asm-generic/io.h:163:2: warning: 'px_cmd' may be used >> uninitialized in this function [-Wuninitialized] drivers/ata/ahci_qoriq.c:70:6: note: 'px_cmd' was declared here This patch fixed it by introducing a local variable. Signed-off-by: Arnd Bergmann --- I found this warning again on gcc version 4.8.3 20131202. So this warning may not go way with newer gcc version. I verified Arnd's suggestion and it works. So please apply this patch which I sent on behalf of Arnd. drivers/ata/ahci_qoriq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c index e5e4988..58c1a94 100644 --- a/drivers/ata/ahci_qoriq.c +++ b/drivers/ata/ahci_qoriq.c @@ -76,6 +76,7 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class, struct ata_taskfile tf; bool online; int rc; + bool ls1021a_workaround = (qoriq_priv->type == AHCI_LS1021A); DPRINTK("ENTER\n"); @@ -92,7 +93,7 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class, * After the sequence is complete, software should restore the * PxCMD and PxIS with the stored values. */ - if (qoriq_priv->type == AHCI_LS1021A) { + if (ls1021a_workaround) { px_cmd = readl(port_mmio + PORT_CMD); px_is = readl(port_mmio + PORT_IRQ_STAT); } @@ -106,7 +107,7 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class, ahci_check_ready); /* restore the PxCMD and PxIS on ls1021 */ - if (qoriq_priv->type == AHCI_LS1021A) { + if (ls1021a_workaround) { px_val = readl(port_mmio + PORT_CMD); if (px_val != px_cmd) writel(px_cmd, port_mmio + PORT_CMD);