All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net trigraph fixes for W=1
@ 2020-10-28  0:22 Andrew Lunn
  2020-10-28  0:22 ` [PATCH net-next 1/2] net: marvell: mvneta: Fix trigraph warning with W=1 Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Andrew Lunn @ 2020-10-28  0:22 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: netdev, Thomas Petazzoni, Ralf Baechle, Andrew Lunn

Both the Marvell mvneta and rose driver accidentally make use of a
trigraph. When compiling with W=1 an warning is issues because we have
trigraphs disabled. So for mvneta, which is only a diagnostic print,
remove the trigraph. For rose, since this is a sysfs file, escape the
sequence to make it clear it is not supposed to be trigraph.

Andrew Lunn (2):
  net: marvell: mvneta: Fix trigraph warning with W=1
  net: rose: Escape trigraph to fix warning with W=1

 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 net/rose/af_rose.c                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.28.0


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

* [PATCH net-next 1/2] net: marvell: mvneta: Fix trigraph warning with W=1
  2020-10-28  0:22 [PATCH net-next 0/2] net trigraph fixes for W=1 Andrew Lunn
@ 2020-10-28  0:22 ` Andrew Lunn
  2020-10-28  0:22 ` [PATCH net-next 2/2] net: rose: Escape trigraph to fix " Andrew Lunn
  2020-10-29 21:47 ` [PATCH net-next 0/2] net trigraph fixes for W=1 Jakub Kicinski
  2 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2020-10-28  0:22 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: netdev, Thomas Petazzoni, Ralf Baechle, Andrew Lunn

drivers/net/ethernet/marvell/mvneta.c: In function ‘mvneta_tx_tso’:
drivers/net/ethernet/marvell/mvneta.c:2651:39: warning: trigraph ??! ignored, use -trigraphs to enable [-Wtrigraphs]
 2651 |   pr_info("*** Is this even  possible???!?!?\n");

Simply the questioning exclamation to a plain question to avoid the warning.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 54b0bf574c05..55f4c49c1278 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2648,7 +2648,7 @@ static int mvneta_tx_tso(struct sk_buff *skb, struct net_device *dev,
 		return 0;
 
 	if (skb_headlen(skb) < (skb_transport_offset(skb) + tcp_hdrlen(skb))) {
-		pr_info("*** Is this even  possible???!?!?\n");
+		pr_info("*** Is this even  possible????\n");
 		return 0;
 	}
 
-- 
2.28.0


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

* [PATCH net-next 2/2] net: rose: Escape trigraph to fix warning with W=1
  2020-10-28  0:22 [PATCH net-next 0/2] net trigraph fixes for W=1 Andrew Lunn
  2020-10-28  0:22 ` [PATCH net-next 1/2] net: marvell: mvneta: Fix trigraph warning with W=1 Andrew Lunn
@ 2020-10-28  0:22 ` Andrew Lunn
  2020-10-29 14:19   ` David Laight
  2020-10-29 21:47 ` [PATCH net-next 0/2] net trigraph fixes for W=1 Jakub Kicinski
  2 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2020-10-28  0:22 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: netdev, Thomas Petazzoni, Ralf Baechle, Andrew Lunn

net/rose/af_rose.c: In function ‘rose_info_show’:
net/rose/af_rose.c:1413:20: warning: trigraph ??- ignored, use -trigraphs to enable [-Wtrigraphs]
 1413 |    callsign = "??????-?";

??- is a trigraph, and should be replaced by a ˜ by the
compiler. However, trigraphs are being ignored in the build. Fix the
warning by escaping the ?? prefix of a trigraph.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 net/rose/af_rose.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index cf7d974e0f61..2c297834d268 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -1410,7 +1410,7 @@ static int rose_info_show(struct seq_file *seq, void *v)
 			   ax2asc(buf, &rose->dest_call));
 
 		if (ax25cmp(&rose->source_call, &null_ax25_address) == 0)
-			callsign = "??????-?";
+			callsign = "????\?\?-?";
 		else
 			callsign = ax2asc(buf, &rose->source_call);
 
-- 
2.28.0


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

* RE: [PATCH net-next 2/2] net: rose: Escape trigraph to fix warning with W=1
  2020-10-28  0:22 ` [PATCH net-next 2/2] net: rose: Escape trigraph to fix " Andrew Lunn
@ 2020-10-29 14:19   ` David Laight
  2020-10-29 14:31     ` Andrew Lunn
  0 siblings, 1 reply; 9+ messages in thread
From: David Laight @ 2020-10-29 14:19 UTC (permalink / raw)
  To: 'Andrew Lunn', Jakub Kicinski
  Cc: netdev, Thomas Petazzoni, Ralf Baechle

From: Andrew Lunn
> Sent: 28 October 2020 00:23
> 
> net/rose/af_rose.c: In function ‘rose_info_show’:
> net/rose/af_rose.c:1413:20: warning: trigraph ??- ignored, use -trigraphs to enable [-Wtrigraphs]
>  1413 |    callsign = "??????-?";
> 
> ??- is a trigraph, and should be replaced by a ˜ by the
> compiler. However, trigraphs are being ignored in the build. Fix the
> warning by escaping the ?? prefix of a trigraph.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  net/rose/af_rose.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
> index cf7d974e0f61..2c297834d268 100644
> --- a/net/rose/af_rose.c
> +++ b/net/rose/af_rose.c
> @@ -1410,7 +1410,7 @@ static int rose_info_show(struct seq_file *seq, void *v)
>  			   ax2asc(buf, &rose->dest_call));
> 
>  		if (ax25cmp(&rose->source_call, &null_ax25_address) == 0)
> -			callsign = "??????-?";
> +			callsign = "????\?\?-?";

I think I'd just split the string, eg: "?????" "-?".

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

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

* Re: [PATCH net-next 2/2] net: rose: Escape trigraph to fix warning with W=1
  2020-10-29 14:19   ` David Laight
@ 2020-10-29 14:31     ` Andrew Lunn
  2020-10-29 14:52       ` David Laight
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2020-10-29 14:31 UTC (permalink / raw)
  To: David Laight; +Cc: Jakub Kicinski, netdev, Thomas Petazzoni, Ralf Baechle

On Thu, Oct 29, 2020 at 02:19:27PM +0000, David Laight wrote:
> From: Andrew Lunn
> > Sent: 28 October 2020 00:23
> > 
> > net/rose/af_rose.c: In function ‘rose_info_show’:
> > net/rose/af_rose.c:1413:20: warning: trigraph ??- ignored, use -trigraphs to enable [-Wtrigraphs]
> >  1413 |    callsign = "??????-?";
> > 
> > ??- is a trigraph, and should be replaced by a ˜ by the
> > compiler. However, trigraphs are being ignored in the build. Fix the
> > warning by escaping the ?? prefix of a trigraph.
> > 
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > ---
> >  net/rose/af_rose.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
> > index cf7d974e0f61..2c297834d268 100644
> > --- a/net/rose/af_rose.c
> > +++ b/net/rose/af_rose.c
> > @@ -1410,7 +1410,7 @@ static int rose_info_show(struct seq_file *seq, void *v)
> >  			   ax2asc(buf, &rose->dest_call));
> > 
> >  		if (ax25cmp(&rose->source_call, &null_ax25_address) == 0)
> > -			callsign = "??????-?";
> > +			callsign = "????\?\?-?";
> 
> I think I'd just split the string, eg: "?????" "-?".

Humm. I think we need a language lawyer.

Does it concatenate the strings and then evaluate for trigraphs? Or
does it evaluate for trigraphs, and then concatenate the strings?

     Andrew

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

* RE: [PATCH net-next 2/2] net: rose: Escape trigraph to fix warning with W=1
  2020-10-29 14:31     ` Andrew Lunn
@ 2020-10-29 14:52       ` David Laight
  2020-10-29 15:13         ` Andrew Lunn
  0 siblings, 1 reply; 9+ messages in thread
From: David Laight @ 2020-10-29 14:52 UTC (permalink / raw)
  To: 'Andrew Lunn'
  Cc: Jakub Kicinski, netdev, Thomas Petazzoni, Ralf Baechle

From: Andrew Lunn
> Sent: 29 October 2020 14:31
> On Thu, Oct 29, 2020 at 02:19:27PM +0000, David Laight wrote:
> > From: Andrew Lunn
> > > Sent: 28 October 2020 00:23
> > >
> > > net/rose/af_rose.c: In function ‘rose_info_show’:
> > > net/rose/af_rose.c:1413:20: warning: trigraph ??- ignored, use -trigraphs to enable [-Wtrigraphs]
> > >  1413 |    callsign = "??????-?";
> > >
> > > ??- is a trigraph, and should be replaced by a ˜ by the
> > > compiler. However, trigraphs are being ignored in the build. Fix the
> > > warning by escaping the ?? prefix of a trigraph.
> > >
> > > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > > ---
> > >  net/rose/af_rose.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
> > > index cf7d974e0f61..2c297834d268 100644
> > > --- a/net/rose/af_rose.c
> > > +++ b/net/rose/af_rose.c
> > > @@ -1410,7 +1410,7 @@ static int rose_info_show(struct seq_file *seq, void *v)
> > >  			   ax2asc(buf, &rose->dest_call));
> > >
> > >  		if (ax25cmp(&rose->source_call, &null_ax25_address) == 0)
> > > -			callsign = "??????-?";
> > > +			callsign = "????\?\?-?";
> >
> > I think I'd just split the string, eg: "?????" "-?".
> 
> Humm. I think we need a language lawyer.
> 
> Does it concatenate the strings and then evaluate for trigraphs? Or
> does it evaluate for trigraphs, and then concatenate the strings?

I'm 99.9999% sure trigraphs are evaluated before string concatenation.

Although trigraphs are such a stupid idea I'd be tempted to just
turn the warning off.
There is good reason why they are ignored by default.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

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

* Re: [PATCH net-next 2/2] net: rose: Escape trigraph to fix warning with W=1
  2020-10-29 14:52       ` David Laight
@ 2020-10-29 15:13         ` Andrew Lunn
  2020-10-29 15:29           ` Arnd Bergmann
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2020-10-29 15:13 UTC (permalink / raw)
  To: David Laight, Arnd Bergmann
  Cc: Jakub Kicinski, netdev, Thomas Petazzoni, Ralf Baechle

On Thu, Oct 29, 2020 at 02:52:52PM +0000, David Laight wrote:
> From: Andrew Lunn
> > Sent: 29 October 2020 14:31
> > On Thu, Oct 29, 2020 at 02:19:27PM +0000, David Laight wrote:
> > > From: Andrew Lunn
> > > > Sent: 28 October 2020 00:23
> > > >
> > > > net/rose/af_rose.c: In function ‘rose_info_show’:
> > > > net/rose/af_rose.c:1413:20: warning: trigraph ??- ignored, use -trigraphs to enable [-Wtrigraphs]
> > > >  1413 |    callsign = "??????-?";
> > > >
> > > > ??- is a trigraph, and should be replaced by a ˜ by the
> > > > compiler. However, trigraphs are being ignored in the build. Fix the
> > > > warning by escaping the ?? prefix of a trigraph.
> > > >
> > > > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > > > ---
> > > >  net/rose/af_rose.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
> > > > index cf7d974e0f61..2c297834d268 100644
> > > > --- a/net/rose/af_rose.c
> > > > +++ b/net/rose/af_rose.c
> > > > @@ -1410,7 +1410,7 @@ static int rose_info_show(struct seq_file *seq, void *v)
> > > >  			   ax2asc(buf, &rose->dest_call));
> > > >
> > > >  		if (ax25cmp(&rose->source_call, &null_ax25_address) == 0)
> > > > -			callsign = "??????-?";
> > > > +			callsign = "????\?\?-?";
> > >
> > > I think I'd just split the string, eg: "?????" "-?".
> > 
> > Humm. I think we need a language lawyer.
> > 
> > Does it concatenate the strings and then evaluate for trigraphs? Or
> > does it evaluate for trigraphs, and then concatenate the strings?
> 
> I'm 99.9999% sure trigraphs are evaluated before string concatenation.
> 
> Although trigraphs are such a stupid idea I'd be tempted to just
> turn the warning off.
> There is good reason why they are ignored by default.

Hi Arnd

I think this trigraph issues popped up because of one of the changes
you have in your playground, adding more warnings.

What do you think of disabling the trigraph warning as well as
disabling trigraphs themselves?

	   Andrew

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

* Re: [PATCH net-next 2/2] net: rose: Escape trigraph to fix warning with W=1
  2020-10-29 15:13         ` Andrew Lunn
@ 2020-10-29 15:29           ` Arnd Bergmann
  0 siblings, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2020-10-29 15:29 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: David Laight, Arnd Bergmann, Jakub Kicinski, netdev,
	Thomas Petazzoni, Ralf Baechle

On Thu, Oct 29, 2020 at 4:13 PM Andrew Lunn <andrew@lunn.ch> wrote:
> On Thu, Oct 29, 2020 at 02:52:52PM +0000, David Laight wrote:
> > From: Andrew Lunn
> > > Sent: 29 October 2020 14:31
>
> I think this trigraph issues popped up because of one of the changes
> you have in your playground, adding more warnings.
>
> What do you think of disabling the trigraph warning as well as
> disabling trigraphs themselves?

The trigraph warnings are currently disabled in mainline, and trigraphs
themselves are disabled in GCC unless explicitly enabled.

My series contained a patch that changes all trigraphs by adding
'\' characters, to let us no longer disable the warning and slightly
simplify the command line:

 drivers/atm/idt77252.c                                  | 2 +-
 drivers/gpu/drm/msm/msm_rd.c                            | 2 +-
 drivers/mtd/maps/sun_uflash.c                           | 2 +-
 drivers/net/ethernet/marvell/mvneta.c                   | 2 +-
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +-
 drivers/s390/block/dasd_proc.c                          | 2 +-
 drivers/scsi/imm.c                                      | 4 ++--
 drivers/scsi/ppa.c                                      | 4 ++--
 drivers/tty/serial/sunsu.c                              | 2 +-
 net/rose/af_rose.c                                      | 4 ++--
 sound/isa/msnd/msnd.c                                   | 2 +-

Sorry you ran into this after you picked up the patches to the
Makefile but not my preparation patch.

I was unsure about whether this is worth changing, so I did not
send that one patch from my series and we can probably just
not drop the -Wno-trigraphs flag.

       Arnd

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

* Re: [PATCH net-next 0/2] net trigraph fixes for W=1
  2020-10-28  0:22 [PATCH net-next 0/2] net trigraph fixes for W=1 Andrew Lunn
  2020-10-28  0:22 ` [PATCH net-next 1/2] net: marvell: mvneta: Fix trigraph warning with W=1 Andrew Lunn
  2020-10-28  0:22 ` [PATCH net-next 2/2] net: rose: Escape trigraph to fix " Andrew Lunn
@ 2020-10-29 21:47 ` Jakub Kicinski
  2 siblings, 0 replies; 9+ messages in thread
From: Jakub Kicinski @ 2020-10-29 21:47 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, Thomas Petazzoni, Ralf Baechle

On Wed, 28 Oct 2020 01:22:33 +0100 Andrew Lunn wrote:
> Both the Marvell mvneta and rose driver accidentally make use of a
> trigraph. When compiling with W=1 an warning is issues because we have
> trigraphs disabled. So for mvneta, which is only a diagnostic print,
> remove the trigraph. For rose, since this is a sysfs file, escape the
> sequence to make it clear it is not supposed to be trigraph.

Feel free to resubmit, with the mentions of W=1 adjusted. 
No preference here.

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

end of thread, other threads:[~2020-10-29 21:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-28  0:22 [PATCH net-next 0/2] net trigraph fixes for W=1 Andrew Lunn
2020-10-28  0:22 ` [PATCH net-next 1/2] net: marvell: mvneta: Fix trigraph warning with W=1 Andrew Lunn
2020-10-28  0:22 ` [PATCH net-next 2/2] net: rose: Escape trigraph to fix " Andrew Lunn
2020-10-29 14:19   ` David Laight
2020-10-29 14:31     ` Andrew Lunn
2020-10-29 14:52       ` David Laight
2020-10-29 15:13         ` Andrew Lunn
2020-10-29 15:29           ` Arnd Bergmann
2020-10-29 21:47 ` [PATCH net-next 0/2] net trigraph fixes for W=1 Jakub Kicinski

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.