From patchwork Fri May 5 19:46:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98679 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp292745qge; Fri, 5 May 2017 12:48:28 -0700 (PDT) X-Received: by 10.98.194.199 with SMTP id w68mr18977143pfk.192.1494013708890; Fri, 05 May 2017 12:48:28 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 144si6012850pfa.118.2017.05.05.12.48.28; Fri, 05 May 2017 12:48:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755427AbdEETs0 (ORCPT + 6 others); Fri, 5 May 2017 15:48:26 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:51105 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752456AbdEETsS (ORCPT ); Fri, 5 May 2017 15:48:18 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0LrEhY-1e2r7w1MNA-0135pR; Fri, 05 May 2017 21:48:12 +0200 From: Arnd Bergmann To: Ben Hutchings Cc: stable@vger.kernel.org, Arnd Bergmann , Tejun Heo Subject: [PATCH 3.16-stable 24/87] ata: hpt366: fix constant cast warning Date: Fri, 5 May 2017 21:46:42 +0200 Message-Id: <20170505194745.3627137-25-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170505194745.3627137-1-arnd@arndb.de> References: <20170505194745.3627137-1-arnd@arndb.de> X-Provags-ID: V03:K0:BfBs9d8Rr65jPkR4vMfusdpckMW6U/JEFWdrmt5MQuTtv4Yaa69 HfDYHCdwEp58rWt3JT3Dtg2HbimRD3YxDNJqMSZgtHM5wCesYtrvU6cxJcd/nN3+3qeur21 wrGbjwpa5fVZ+j5yRkZF/cwyfeA45ZLGegeLnQGI3HWJpVauMwzqfDCpEV/AGiDFp1igZKs ECm2i1Mv+0xFhRI4cwZ+w== X-UI-Out-Filterresults: notjunk:1; V01:K0:xxfarrFVTHU=:x3629dp0l0T00uKcGIev1v B0SLLmBvEcsoKwzMPOFP4bMJXOHUd8EIhWe0MXHNekoi3eJr55ZNSyPkt8TbIpManI8YpSmBk gfp1gLGP9e5RQYJZVvcEnynRn4PE17mSHl76BbdQ+1B0jmruqFHcqWytKYdKN/0S04CuFpF4F d03Nu/UubAWjsmKWCWvTSF2VeyIVIPSrJuEUhpVXMaQfnCCvpn6tVpK8TjtaqqqYt8gIOjCIc odVObwnc4z46f3FZcF6rKsnFRER7pm8kAPbe0hM3BiPUUxkSrHRcpNumw8Jd5IIfDQ4mp0q7Y 6ikw+vOlOWq8GIWRXv2o8NdORMEeqvJVPl4flU8h/1tKk1QWY0HRBxfYtKUZKqzKyuy9RNkrs ES4E7wwkpPRyw6AV1PDTOoVQsHOge0SDYRj6B9XBv3ZVlYe2a+SPs8+YKlrfVe+aHpm43hLpV IXpkHNztaKT6UGnr8Nl3d7s8feaNNvybIuQN4L2EDmRc3b3pEXi9YuyOUTHTGzlfSHviGMPm4 eSepPAFjgmTC5I3uxPLsN2wj8UV4sKlYnQovXPbSuvbs0kOMr5XI5VExk+0APsAUM99J+3Nxj nJ0wTwlMoqNt+uv/6O9/ozkJJ8FOkr4o/xIecturKJrvYQbKIql4jng/x6AX3JOcxsRqse3AB Qs1HhWD7hb2yw7uK44qgypkPPAWHEIl0h73AfTmZ/JWGG74eCQxRWFepV9XvpYSoHfzc= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Commit c4c54a7b7dbf62ab1b15df88a23cbd0900b1bef3 upstream. gcc-5.x warns about a preexisting problem in the hpt36x pata driver: drivers/ata/pata_hpt366.c: In function 'hpt36x_init_one': drivers/ata/pata_hpt366.c:376:9: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers] Other ata drivers have the same problem, as ata_pci_bmdma_init_one takes a non-const pointer, and they solve it by using a cast to turn that pointer into a normal non-const pointer. I also tried to change the ata core code to make host->private_data a const pointer, but that quickly got out of hand, as some other drivers expect it to be writable, so I ended up using the same hack as the others here. Signed-off-by: Arnd Bergmann Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Tejun Heo Signed-off-by: Arnd Bergmann --- drivers/ata/pata_hpt366.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c index cbc3de793d1d..0038dc4c06c7 100644 --- a/drivers/ata/pata_hpt366.c +++ b/drivers/ata/pata_hpt366.c @@ -352,7 +352,7 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id) }; const struct ata_port_info *ppi[] = { &info_hpt366, NULL }; - void *hpriv = NULL; + const void *hpriv = NULL; u32 reg1; int rc; @@ -383,7 +383,7 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id) break; } /* Now kick off ATA set up */ - return ata_pci_bmdma_init_one(dev, ppi, &hpt36x_sht, hpriv, 0); + return ata_pci_bmdma_init_one(dev, ppi, &hpt36x_sht, (void *)hpriv, 0); } #ifdef CONFIG_PM_SLEEP