All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH, RESEND] serial-uartlite: un-constify uartlite_be/uartlite_le
@ 2016-04-17  0:12 Arnd Bergmann
  2016-04-17  0:39 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2016-04-17  0:12 UTC (permalink / raw)
  To: Peter Korsgaard, Greg Kroah-Hartman
  Cc: Arnd Bergmann, Jiri Slaby, Maarten Brock, Rich Felker,
	Michal Simek, linux-serial, linux-kernel

The patch to make uartlite_be/uartlite_le const was well-intended but
caused a new build warning:

tty/serial/uartlite.c: In function 'ulite_request_port':
tty/serial/uartlite.c:348:21: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
tty/serial/uartlite.c:354:22: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]

It would be nice to allow passing const pointers through
port->private_data, but that would be way more work, so this
reverts part of the original commit for now.

A possible alternative might be to pass a structure in the private_data
that contains a const pointer to the operations, which introduces a little
extra overhead, or we could just add a cast to a non-const pointer, I'll
leave that to the maintainer.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 2905697a82ea ("serial-uartlite: Constify uartlite_be/uartlite_le")
---
 drivers/tty/serial/uartlite.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

I sent this patch on March 10, but it never made it in.

Greg, could you apply the patch as a bugfix for 4.6? The warning is
annoying as it shows up in several defconfig builds and allmodconfig.

diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index c9fdfc8bf47f..1474c5755140 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -72,7 +72,7 @@ static void uartlite_outbe32(u32 val, void __iomem *addr)
 	iowrite32be(val, addr);
 }
 
-static const struct uartlite_reg_ops uartlite_be = {
+static struct uartlite_reg_ops uartlite_be = {
 	.in = uartlite_inbe32,
 	.out = uartlite_outbe32,
 };
@@ -87,7 +87,7 @@ static void uartlite_outle32(u32 val, void __iomem *addr)
 	iowrite32(val, addr);
 }
 
-static const struct uartlite_reg_ops uartlite_le = {
+static struct uartlite_reg_ops uartlite_le = {
 	.in = uartlite_inle32,
 	.out = uartlite_outle32,
 };
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH, RESEND] serial-uartlite: un-constify uartlite_be/uartlite_le
  2016-04-17  0:12 [PATCH, RESEND] serial-uartlite: un-constify uartlite_be/uartlite_le Arnd Bergmann
@ 2016-04-17  0:39 ` Greg Kroah-Hartman
  2016-04-17 16:59   ` Sudip Mukherjee
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2016-04-17  0:39 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Peter Korsgaard, Jiri Slaby, Maarten Brock, Rich Felker,
	Michal Simek, linux-serial, linux-kernel

On Sun, Apr 17, 2016 at 02:12:47AM +0200, Arnd Bergmann wrote:
> The patch to make uartlite_be/uartlite_le const was well-intended but
> caused a new build warning:
> 
> tty/serial/uartlite.c: In function 'ulite_request_port':
> tty/serial/uartlite.c:348:21: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
> tty/serial/uartlite.c:354:22: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
> 
> It would be nice to allow passing const pointers through
> port->private_data, but that would be way more work, so this
> reverts part of the original commit for now.
> 
> A possible alternative might be to pass a structure in the private_data
> that contains a const pointer to the operations, which introduces a little
> extra overhead, or we could just add a cast to a non-const pointer, I'll
> leave that to the maintainer.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 2905697a82ea ("serial-uartlite: Constify uartlite_be/uartlite_le")
> ---
>  drivers/tty/serial/uartlite.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> I sent this patch on March 10, but it never made it in.
> 
> Greg, could you apply the patch as a bugfix for 4.6? The warning is
> annoying as it shows up in several defconfig builds and allmodconfig.

Ugh, sorry about this, will get to it soon...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, RESEND] serial-uartlite: un-constify uartlite_be/uartlite_le
  2016-04-17  0:39 ` Greg Kroah-Hartman
@ 2016-04-17 16:59   ` Sudip Mukherjee
  2016-04-19  6:14     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2016-04-17 16:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Arnd Bergmann, Peter Korsgaard, Jiri Slaby, Maarten Brock,
	Rich Felker, Michal Simek, linux-serial, linux-kernel

On Sunday 17 April 2016 06:09 AM, Greg Kroah-Hartman wrote:
> On Sun, Apr 17, 2016 at 02:12:47AM +0200, Arnd Bergmann wrote:
>> The patch to make uartlite_be/uartlite_le const was well-intended but
>> caused a new build warning:
>>
>> tty/serial/uartlite.c: In function 'ulite_request_port':
>> tty/serial/uartlite.c:348:21: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
>> tty/serial/uartlite.c:354:22: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
>>
>> It would be nice to allow passing const pointers through
>> port->private_data, but that would be way more work, so this
>> reverts part of the original commit for now.
>>
>> A possible alternative might be to pass a structure in the private_data
>> that contains a const pointer to the operations, which introduces a little
>> extra overhead, or we could just add a cast to a non-const pointer, I'll
>> leave that to the maintainer.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> Fixes: 2905697a82ea ("serial-uartlite: Constify uartlite_be/uartlite_le")
>> ---
>>   drivers/tty/serial/uartlite.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> I sent this patch on March 10, but it never made it in.
>>
>> Greg, could you apply the patch as a bugfix for 4.6? The warning is
>> annoying as it shows up in several defconfig builds and allmodconfig.
>
> Ugh, sorry about this, will get to it soon...
>

A revert patch with the same effect posted on 11th April is also in 
waiting. http://www.spinics.net/lists/linux-serial/msg22287.html

regards
sudip

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, RESEND] serial-uartlite: un-constify uartlite_be/uartlite_le
  2016-04-17 16:59   ` Sudip Mukherjee
@ 2016-04-19  6:14     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2016-04-19  6:14 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Arnd Bergmann, Peter Korsgaard, Jiri Slaby, Maarten Brock,
	Rich Felker, Michal Simek, linux-serial, linux-kernel

On Sun, Apr 17, 2016 at 10:29:51PM +0530, Sudip Mukherjee wrote:
> On Sunday 17 April 2016 06:09 AM, Greg Kroah-Hartman wrote:
> > On Sun, Apr 17, 2016 at 02:12:47AM +0200, Arnd Bergmann wrote:
> > > The patch to make uartlite_be/uartlite_le const was well-intended but
> > > caused a new build warning:
> > > 
> > > tty/serial/uartlite.c: In function 'ulite_request_port':
> > > tty/serial/uartlite.c:348:21: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
> > > tty/serial/uartlite.c:354:22: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
> > > 
> > > It would be nice to allow passing const pointers through
> > > port->private_data, but that would be way more work, so this
> > > reverts part of the original commit for now.
> > > 
> > > A possible alternative might be to pass a structure in the private_data
> > > that contains a const pointer to the operations, which introduces a little
> > > extra overhead, or we could just add a cast to a non-const pointer, I'll
> > > leave that to the maintainer.
> > > 
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > Fixes: 2905697a82ea ("serial-uartlite: Constify uartlite_be/uartlite_le")
> > > ---
> > >   drivers/tty/serial/uartlite.c | 4 ++--
> > >   1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > I sent this patch on March 10, but it never made it in.
> > > 
> > > Greg, could you apply the patch as a bugfix for 4.6? The warning is
> > > annoying as it shows up in several defconfig builds and allmodconfig.
> > 
> > Ugh, sorry about this, will get to it soon...
> > 
> 
> A revert patch with the same effect posted on 11th April is also in waiting.
> http://www.spinics.net/lists/linux-serial/msg22287.html

Sorry for the delay, will go queue that one up now...

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-19  6:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-17  0:12 [PATCH, RESEND] serial-uartlite: un-constify uartlite_be/uartlite_le Arnd Bergmann
2016-04-17  0:39 ` Greg Kroah-Hartman
2016-04-17 16:59   ` Sudip Mukherjee
2016-04-19  6:14     ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.