Skip to contentSkip to conversation

bikeshed: [PATCH -next] mfd: rave-sp: convert comma to semicolon

DISCUSSION David Laight 2 participants 4 messages Dec 11, 2020

lore
Share & tools
lore
#0 lore raw

From: Lee Jones

Quoted 17 lines

Sent: 11 December 2020 10:06

Quoted 13 lines · Zheng Yongjun

Replace a comma between expression statements by a semicolon.

---
 drivers/mfd/rave-sp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/rave-sp.c +0 -0
index 545196c85b5c..abb9cbdabaa9 100644
@@ -358,7 +358,7 @@ int rave_sp_exec(struct rave_sp *sp,
 
Quoted 6 lines

drivers/mfd/rave-sp.c int rave_sp_exec(struct rave_sp *sp, · line 361

Quoted 4 lines
drivers/mfd/rave-sp.c +1 -1
 	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)

#1 lore raw

Why does your mailer thread emails?

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

Quoted 18 lines · David Laight

From: Lee Jones

Quoted 17 lines

Sent: 11 December 2020 10:06

Quoted 13 lines · Zheng Yongjun

Replace a comma between expression statements by a semicolon.

---
 drivers/mfd/rave-sp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/rave-sp.c +0 -0
index 545196c85b5c..abb9cbdabaa9 100644
@@ -358,7 +358,7 @@ int rave_sp_exec(struct rave_sp *sp,
 
Quoted 8 lines
Quoted 6 lines

drivers/mfd/rave-sp.c int rave_sp_exec(struct rave_sp *sp, · line 361

Quoted 4 lines
drivers/mfd/rave-sp.c +1 -1
 	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!

Quoted 3 lines

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.

Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#2 lore raw

From: Lee Jones

Quoted 1 line

Sent: 11 December 2020 13:11

...

Quoted 9 lines
Quoted 1 line

Nowt wrong with commas.

Well you learn something new every day!

Quoted 3 lines

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)

#3 lore raw
Quoted 25 lines · David Laight

From: Lee Jones

Quoted 1 line

Sent: 11 December 2020 13:11

...

Quoted 9 lines
Quoted 1 line

Nowt wrong with commas.

Well you learn something new every day!

Quoted 3 lines

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;
Quoted 2 lines

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.

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