From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752847AbbETLTp (ORCPT ); Wed, 20 May 2015 07:19:45 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:42834 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752494AbbETLTn (ORCPT ); Wed, 20 May 2015 07:19:43 -0400 X-AuditID: cbfee61a-f79516d000006302-8c-555c6dcc6804 From: Bartlomiej Zolnierkiewicz To: Arnd Bergmann Cc: Tejun Heo , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] ata: hpt366: fix constant cast warning Date: Wed, 20 May 2015 13:18:47 +0200 Message-id: <1603711.yg6aGn68IJ@amdc1976> User-Agent: KMail/4.13.3 (Linux/3.13.0-51-generic; KDE/4.13.3; x86_64; ; ) In-reply-to: <2549322.XbiTlcDvMS@wuerfel> References: <2549322.XbiTlcDvMS@wuerfel> MIME-version: 1.0 Content-transfer-encoding: 7Bit Content-type: text/plain; charset=us-ascii X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsVy+t9jAd2zuTGhBs9qLP5OOsZusenxNVaL YzseMVlc3jWHzeLX8qOMDqwev39NYvTYtKqTzWPzknqPz5vkAliiuGxSUnMyy1KL9O0SuDI+ XzrOWLCMr6L3fRNzA+Mp7i5GDg4JAROJZwuCuxg5gUwxiQv31rN1MXJxCAksYpQ4sqKJEcL5 yihx/0sXI0gVm4CVxMT2VWC2iICixNQXz5hBbGaBOomFT5+zg9jCAtYSh/5MYAOxWQRUJSa2 zWMFsXkFNCV+/joPZosKeEkcmrIBzOYEis8528sEYgsJaEj86Z3KBlEvKPFj8j0WiPnyEvv2 T2WFsLUk1u88zjSBUWAWkrJZSMpmISlbwMi8ilE0tSC5oDgpPddQrzgxt7g0L10vOT93EyM4 hJ9J7WBc2WBxiFGAg1GJh7fgQHSoEGtiWXFl7iFGCQ5mJRHeq2kxoUK8KYmVValF+fFFpTmp xYcYpTlYlMR5T+b7hAoJpCeWpGanphakFsFkmTg4pRoYzYIlP4r7myfrfwvQuh5jcbflwofU Rca6iW3m7x0MnV6suNlZ2pTBv0j+xBLmoCOOBsu+ZecmHunWrGpYFy54R+WU3OmzevP//5Bw LPC6Ex57+ZZZLPOJS/tWlrG+sBHbrXeXyyXK3vqN9Odt2sWfAiwKt6gonV1u9O6tkNul2YEZ QoFcfv5KLMUZiYZazEXFiQD/WHAQXQIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tuesday, May 19, 2015 04:34:05 PM Arnd Bergmann wrote: > 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 Your patch looks fine to me, thanks. Acked-by: Bartlomiej Zolnierkiewicz Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics > 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