Skip to contentSkip to conversation

staging: android: fix coding style error

PATCH In review Patrick Boettcher 4 participants 6 messages Jan 14, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: android: fix coding style error

Simple style fix - 80 char limit was exceeded.

Context: eudyptula challenge (http://eudyptula-challenge.org/)

Cc Greg Kroah-Hartman <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc John Stultz <[email protected]>
Cc Peter Senna Tschudin <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Tapasweni Pathak <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/staging/android/sync_debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/android/sync_debug.c +2 -1
index 1532a86..9a2aaf8 100644
@@ -96,7 +96,8 @@ static void sync_print_pt(struct seq_file *s, struct sync_pt *pt, bool fence)
 		   sync_status_str(status));
 
 	if (status <= 0) {
-		struct timespec64 ts64 = ktime_to_timespec64(pt->base.timestamp);
+		struct timespec64 ts64 =
+		    ktime_to_timespec64(pt->base.timestamp);
 
 		seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, ts64.tv_nsec);
 	}
Signature · 1 line
2.1.4
#1 lore raw
Quoted 6 lines · On Wednesday 14 January 2015 09:20:42 Patrick Boettcher wrote:
drivers/staging/android/sync_debug.c +0 -0
index 1532a86..9a2aaf8 100644

drivers/staging/android/sync_debug.c static void sync_print_pt(struct seq_file *s, struct sync_pt *pt, bool fence) · line 103

Quoted 9 lines
drivers/staging/android/sync_debug.c +2 -1
@@ -96,7 +96,8 @@ static void sync_print_pt(struct seq_file *s, struct sync_pt *pt, bool fence)
                   sync_status_str(status));
 
        if (status <= 0) {
-               struct timespec64 ts64 = ktime_to_timespec64(pt->base.timestamp);
+               struct timespec64 ts64 =
+                   ktime_to_timespec64(pt->base.timestamp);
 
                seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, ts64.tv_nsec);
        }

You are not really improving readability by just wrapping the line arbitrarily though.

If you're offended by the long line, better rework the code so the long line is not needed.

Arnd

#2 lore raw
Quoted 2 lines · Arnd Bergmann

drivers/staging/android/sync_debug.c

Quoted 1 line · On Wednesday 14 January 2015 09:20:42 Patrick Boettcher wrote:
drivers/staging/android/sync_debug.c +0 -0

[]

Quoted 15 lines

drivers/staging/android/sync_debug.c static void sync_print_pt(struct seq_file *s, struct sync_pt *pt, bool fence) · line 103

Quoted 11 lines
drivers/staging/android/sync_debug.c +2 -1
@@ -96,7 +96,8 @@ static void sync_print_pt(struct seq_file *s, struct sync_pt *pt, bool fence)
                   sync_status_str(status));
 
        if (status <= 0) {
-               struct timespec64 ts64 = ktime_to_timespec64(pt->base.timestamp);
+               struct timespec64 ts64 =
+                   ktime_to_timespec64(pt->base.timestamp);
 
                seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, ts64.tv_nsec);
        }

You are not really improving readability by just wrapping the line arbitrarily though.

Quoted 2 lines

If you're offended by the long line, better rework the code so the long line is not needed.

Generally the best way to do that is to separate
the declaration from the initialization like:

	if (status <= 0) {
		struct timespec64 ts64;

		ts64 = ktime_to_timespec64(pt->base.timestamp);
		seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, ts64.tv_nsec);
	}
#3 lore raw

PATCH 1/1 staging: android: fix coding style error (v2)

Simple style fix - 80 char limit was exceeded.

This is second version of the patch. Thanks Joe Perches.

Context: eudyptula challenge (http://eudyptula-challenge.org/)

Cc Greg Kroah-Hartman <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc John Stultz <[email protected]>
Cc Peter Senna Tschudin <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Tapasweni Pathak <[email protected]>
Cc Joe Perches <[email protected]>
---
 drivers/staging/android/sync_debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/android/sync_debug.c +2 -1
index 1532a86..d6edf37 100644
@@ -96,8 +96,9 @@ static void sync_print_pt(struct seq_file *s, struct sync_pt *pt, bool fence)
 		   sync_status_str(status));
 
 	if (status <= 0) {
-		struct timespec64 ts64 = ktime_to_timespec64(pt->base.timestamp);
+		struct timespec64 ts64;
 
+		ts64 = ktime_to_timespec64(pt->base.timestamp);
 		seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, ts64.tv_nsec);
 	}
 
Signature · 1 line
2.1.4
#4 lore raw

Re: [PATCH] staging: android: fix coding style error (v2)

Put the v2 in "[PATCH v2]" so that it gets removed and not stored in the permanent changelog.

Quoted 3 lines · Patrick Boettcher

Simple style fix - 80 char limit was exceeded.

This is second version of the patch. Thanks Joe Perches.

Put this line under the -- cut off.

Quoted 2 lines

Context: eudyptula challenge (http://eudyptula-challenge.org/)

Don't write this line.

Quoted 13 lines
Cc Greg Kroah-Hartman <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc John Stultz <[email protected]>
Cc Peter Senna Tschudin <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Tapasweni Pathak <[email protected]>
Cc Joe Perches <[email protected]>

This block is not needed. This is a whitespace patch not something controversial where we will need to look at who was CC'd so that we can get annoyed at them for ignoring critical information.

regards,
dan carpenter

#5 lore raw

Re: [PATCH] staging: android: fix coding style error (v2)

Hi Dan,

Thanks for your valuable input. It's appreciated.

Quoted 5 lines · On Wed, 14 Jan 2015 12:28:44 +0300 Dan Carpenter <[email protected]>…
Quoted 1 line

lots of Cc:'s [..]

This block is not needed. This is a whitespace patch not something controversial where we will need to look at who was CC'd so that we can get annoyed at them for ignoring critical information.

Yes, I was wondering which criteria to apply for stripping off people from the get_maintainer.pl-output - and that even though my patch is brilliant ;-).

Thanks again,
--
Patrick.