linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bikeshed: [PATCH -next] mfd: rave-sp: convert comma to semicolon
@ 2020-12-11 11:14 David Laight
  2020-12-11 13:10 ` Lee Jones
  0 siblings, 1 reply; 4+ messages in thread
From: David Laight @ 2020-12-11 11:14 UTC (permalink / raw)
  To: 'Lee Jones', Zheng Yongjun; +Cc: linux-kernel

From: Lee Jones
> Sent: 11 December 2020 10:06
> 
> On Fri, 11 Dec 2020, Zheng Yongjun wrote:
> 
> > Replace a comma between expression statements by a semicolon.
> >
> > Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> > ---
> >  drivers/mfd/rave-sp.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mfd/rave-sp.c b/drivers/mfd/rave-sp.c
> > index 545196c85b5c..abb9cbdabaa9 100644
> > --- a/drivers/mfd/rave-sp.c
> > +++ b/drivers/mfd/rave-sp.c
> > @@ -358,7 +358,7 @@ int rave_sp_exec(struct rave_sp *sp,
> >
> >  	ackid       = atomic_inc_return(&sp->ackid);
> >  	reply.ackid = ackid;
> > -	reply.code  = rave_sp_reply_code((u8)command),
> > +	reply.code  = rave_sp_reply_code((u8)command);
> 
> How did the original code not create a build error?

Nowt wrong with commas.

Why not go the other way.
Convert almost all the ; to , and delete most of the { } in
if and for statements (etc).

	David

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

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

* Re: bikeshed: [PATCH -next] mfd: rave-sp: convert comma to semicolon
  2020-12-11 11:14 bikeshed: [PATCH -next] mfd: rave-sp: convert comma to semicolon David Laight
@ 2020-12-11 13:10 ` Lee Jones
  2020-12-11 13:15   ` David Laight
  0 siblings, 1 reply; 4+ messages in thread
From: Lee Jones @ 2020-12-11 13:10 UTC (permalink / raw)
  To: David Laight; +Cc: Zheng Yongjun, linux-kernel

Why does your mailer thread emails?

Your reply is not detached from the remainder of the thread.

On Fri, 11 Dec 2020, David Laight wrote:
> From: Lee Jones
> > Sent: 11 December 2020 10:06
> > 
> > On Fri, 11 Dec 2020, Zheng Yongjun wrote:
> > 
> > > Replace a comma between expression statements by a semicolon.
> > >
> > > Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> > > ---
> > >  drivers/mfd/rave-sp.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/mfd/rave-sp.c b/drivers/mfd/rave-sp.c
> > > index 545196c85b5c..abb9cbdabaa9 100644
> > > --- a/drivers/mfd/rave-sp.c
> > > +++ b/drivers/mfd/rave-sp.c
> > > @@ -358,7 +358,7 @@ int rave_sp_exec(struct rave_sp *sp,
> > >
> > >  	ackid       = atomic_inc_return(&sp->ackid);
> > >  	reply.ackid = ackid;
> > > -	reply.code  = rave_sp_reply_code((u8)command),
> > > +	reply.code  = rave_sp_reply_code((u8)command);
> > 
> > How did the original code not create a build error?
> 
> Nowt wrong with commas.

Well you learn something new every day!

> Why not go the other way.
> Convert almost all the ; to , and delete most of the { } in
> if and for statements (etc).

Sorry, I don't understand.  Please elaborate/provide an example.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* RE: bikeshed: [PATCH -next] mfd: rave-sp: convert comma to semicolon
  2020-12-11 13:10 ` Lee Jones
@ 2020-12-11 13:15   ` David Laight
  2020-12-11 14:45     ` Lee Jones
  0 siblings, 1 reply; 4+ messages in thread
From: David Laight @ 2020-12-11 13:15 UTC (permalink / raw)
  To: 'Lee Jones'; +Cc: Zheng Yongjun, linux-kernel

From: Lee Jones
> Sent: 11 December 2020 13:11
...
> > Nowt wrong with commas.
> 
> Well you learn something new every day!
> 
> > Why not go the other way.
> > Convert almost all the ; to , and delete most of the { } in
> > if and for statements (etc).
> 
> Sorry, I don't understand.  Please elaborate/provide an example.

You can (largely) replace:
	if (...) {
		xxx;
		yyy;
	}
	zzz;
With
	if (...)
		xxx,
		yyy;
	zzz;

Saves a vertical line....
You may need to replace some 'if' by ?: to avoid the terminating ;

	David

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

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

* Re: bikeshed: [PATCH -next] mfd: rave-sp: convert comma to semicolon
  2020-12-11 13:15   ` David Laight
@ 2020-12-11 14:45     ` Lee Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2020-12-11 14:45 UTC (permalink / raw)
  To: David Laight; +Cc: Zheng Yongjun, linux-kernel

On Fri, 11 Dec 2020, David Laight wrote:

> From: Lee Jones
> > Sent: 11 December 2020 13:11
> ...
> > > Nowt wrong with commas.
> > 
> > Well you learn something new every day!
> > 
> > > Why not go the other way.
> > > Convert almost all the ; to , and delete most of the { } in
> > > if and for statements (etc).
> > 
> > Sorry, I don't understand.  Please elaborate/provide an example.
> 
> You can (largely) replace:
> 	if (...) {
> 		xxx;
> 		yyy;
> 	}
> 	zzz;
> With
> 	if (...)
> 		xxx,
> 		yyy;
> 	zzz;
> 
> Saves a vertical line....
> You may need to replace some 'if' by ?: to avoid the terminating ;

No, please don't do any of that.

The current patch is fine.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2020-12-11 15:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11 11:14 bikeshed: [PATCH -next] mfd: rave-sp: convert comma to semicolon David Laight
2020-12-11 13:10 ` Lee Jones
2020-12-11 13:15   ` David Laight
2020-12-11 14:45     ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).