Skip to contentSkip to conversation

Staging: line6: fixed 80 character coding style issue in midibuf.c This is a patch to the midibuf.c file that fixes up an 80 character error thrown by the checkpatch.pl tool Signed-off-by: Johan Meiring <[email protected]>

PATCH In review Johan Meiring 2 participants 2 messages Mar 28, 2010 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Staging: line6: fixed 80 character coding style issue in midibuf.c This is a patch to the midibuf.c file that fixes up an 80 character error thrown by the checkpatch.pl tool Signed-off-by: Johan Meiring <[email protected]>

---
 drivers/staging/line6/midibuf.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/staging/line6/midibuf.c +6 -3
index ab0a5f3..fb2658d 100644
@@ -76,7 +76,8 @@ int midibuf_bytes_free(struct MidiBuffer *this)
 	return
 		midibuf_is_full(this) ?
 		0 :
-		(this->pos_read - this->pos_write + this->size - 1) % this->size + 1;
+		(this->pos_read - this->pos_write + this->size - 1) % \
+			this->size + 1;
 }
 
 int midibuf_bytes_used(struct MidiBuffer *this)
@@ -84,7 +85,8 @@ int midibuf_bytes_used(struct MidiBuffer *this)
 	return
 		midibuf_is_empty(this) ?
 		0 :
-		(this->pos_write - this->pos_read + this->size - 1) % this->size + 1;
+		(this->pos_write - this->pos_read + this->size - 1) % \
+			this->size + 1;
 }
 
 int midibuf_write(struct MidiBuffer *this, unsigned char *data, int length)
@@ -160,7 +162,8 @@ int midibuf_read(struct MidiBuffer *this, unsigned char *data, int length)
 		this->command_prev = command;
 	} else {
 		if (this->command_prev > 0) {
-			int midi_length_prev = midibuf_message_length(this->command_prev);
+			int midi_length_prev = \
+				midibuf_message_length(this->command_prev);
 
 			if (midi_length_prev > 0) {
 				midi_length = midi_length_prev - 1;
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 9 lines · Johan Meiring
---
 drivers/staging/line6/midibuf.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/staging/line6/midibuf.c +0 -0
index ab0a5f3..fb2658d 100644

drivers/staging/line6/midibuf.c int midibuf_bytes_free(struct MidiBuffer *this) · line 80

Quoted 6 lines
drivers/staging/line6/midibuf.c +2 -1
@@ -76,7 +76,8 @@ int midibuf_bytes_free(struct MidiBuffer *this)
 	return
 		midibuf_is_full(this) ?
 		0 :
-		(this->pos_read - this->pos_write + this->size - 1) % this->size + 1;
+		(this->pos_read - this->pos_write + this->size - 1) % \
+			this->size + 1;

It's not necessary to use line continuations like this.

this is an unfortunate variable name, it might be better to rename it to mb or something.

The "(write - read + size) % size + 1" might be used a couple of times. Maybe use a macro or function?