Skip to contentSkip to conversation

Staging: iio: accel : sca3000_ring: Fixing code styling issues

PATCH In review [email protected] 3 participants 3 messages Apr 6, 2011 – Apr 7, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 4/4 Staging: iio: accel : sca3000_ring: Fixing code styling issues

From: Michael Nijs <[email protected]>

Fixed code styling issue.

---
 drivers/staging/iio/accel/sca3000_ring.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/iio/accel/sca3000_ring.c +1 -1
index fd1c844..c872fdd 100644
@@ -91,7 +91,7 @@ static int sca3000_rip_hw_rb(struct iio_ring_buffer *r,
 
 	/* Convert byte order and shift to default resolution */
 	if (st->bpse == 11) {
-		samples = (s16 *)(*data+1);
+		samples = (s16*)(*data+1);
 		for (i = 0; i < (num_read/2); i++) {
 			samples[i] = be16_to_cpup(
 					(__be16 *)&(samples[i]));
Signature · 1 line
1.7.2.5
#1 lore raw
Quoted 14 lines · On Wed, Apr 6, 2011 at 9:14 PM, <[email protected]> wrote:

From: Michael Nijs <[email protected]>

Fixed code styling issue.

---
 drivers/staging/iio/accel/sca3000_ring.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/iio/accel/sca3000_ring.c +0 -0
index fd1c844..c872fdd 100644

drivers/staging/iio/accel/sca3000_ring.c static int sca3000_rip_hw_rb(struct iio_ring_buffer *r, · line 94

Quoted 5 lines
drivers/staging/iio/accel/sca3000_ring.c +1 -1
@@ -91,7 +91,7 @@ static int sca3000_rip_hw_rb(struct iio_ring_buffer *r,
 
        /* Convert byte order and shift to default resolution */
        if (st->bpse == 11) {
-               samples = (s16 *)(*data+1);
+               samples = (s16*)(*data+1);

Strange. My output(latest 2.6.39-rc2):
./scripts/checkpatch.pl -f drivers/staging/iio/accel/sca3000_ring.c
ERROR: "(foo*)" should be "(foo *)"
#94: FILE: staging/iio/accel/sca3000_ring.c:94:
+ samples = (s16*)(*data+1);

So for me it seems it was correct and you post patch with change where checkpatch will bark. Or am I missing something?

Quoted 6 lines
drivers/staging/iio/accel/sca3000_ring.c +0 -0
                for (i = 0; i < (num_read/2); i++) {

                       samples[i] = be16_to_cpup( (__be16 *)&(samples[i])); --
1.7.2.5

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

thanks,

marek

Signature · 10 lines
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com
#2 lore raw
Quoted 26 lines · Belisko Marek
Quoted 14 lines · On Wed, Apr 6, 2011 at 9:14 PM, <[email protected]> wrote:

From: Michael Nijs <[email protected]>

Fixed code styling issue.

---
 drivers/staging/iio/accel/sca3000_ring.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/iio/accel/sca3000_ring.c +0 -0
index fd1c844..c872fdd 100644

drivers/staging/iio/accel/sca3000_ring.c static int sca3000_rip_hw_rb(struct iio_ring_buffer *r, · line 94

Quoted 5 lines
drivers/staging/iio/accel/sca3000_ring.c +1 -1
@@ -91,7 +91,7 @@ static int sca3000_rip_hw_rb(struct iio_ring_buffer *r,
 
       /* Convert byte order and shift to default resolution */
       if (st->bpse == 11) {
-               samples = (s16 *)(*data+1);
+               samples = (s16*)(*data+1);

Strange. My output(latest 2.6.39-rc2):
./scripts/checkpatch.pl -f drivers/staging/iio/accel/sca3000_ring.c
ERROR: "(foo*)" should be "(foo *)"
#94: FILE: staging/iio/accel/sca3000_ring.c:94:

drivers/staging/iio/accel/sca3000_ring.c +1 -0
+		samples = (s16*)(*data+1);
Quoted 5 lines

So for me it seems it was correct and you post patch with change where checkpatch will bark. Or am I missing something?

Quoted 3 lines
drivers/staging/iio/accel/sca3000_ring.c +0 -0
               for (i = 0; i < (num_read/2); i++) {
                       samples[i] = be16_to_cpup(
                                       (__be16 *)&(samples[i]));

There are some much nastier issues with that section of code. If nothing else I dread to think what be16_to_cpup does with unaligned pointers. There's a rewrite of this code in my local tree anyway so either way the issue will probably go away shortly!

Thanks anyway.

Jonathan