Skip to contentSkip to conversation

fix some coding style problem in drivers/staging/iio/frequency/ad9832.c

PATCH In review Federico Di Pierro 5 participants 5 messages Jun 2, 2014

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

PATCH 1/1 fix some coding style problem in drivers/staging/iio/frequency/ad9832.c

Hi!
This is my latest task of the eudyptula challenge.
Just a very small patch! It fixes 3 little coding style problems. I'm using linux-next.

drivers/staging/iio/frequency/ad9832.c renamed from drivers/staging/iio/frequency/ad9832.c.orig +5 -5
@@ -57,7 +57,7 @@ static int ad9832_write_frequency(struct
 }
 
 static int ad9832_write_phase(struct ad9832_state *st,
-				  unsigned long addr, unsigned long phase)
+			      unsigned long addr, unsigned long phase)
 {
 	if (phase > (1 << AD9832_PHASE_BITS))
 		return -EINVAL;
@@ -73,7 +73,7 @@ static int ad9832_write_phase(struct ad9
 }
 
 static ssize_t ad9832_write(struct device *dev,
-		struct device_attribute *attr,
+			    struct device_attribute *attr,
 		const char *buf,
 		size_t len)
 {
@@ -109,11 +109,11 @@ static ssize_t ad9832_write(struct devic
 		ret = spi_sync(st->spi, &st->msg);
 		break;
 	case AD9832_FREQ_SYM:
-		if (val == 1)
+		if (val == 1) {
 			st->ctrl_fp |= AD9832_FREQ;
-		else if (val == 0)
+		} else if (val == 0) {
 			st->ctrl_fp &= ~AD9832_FREQ;
-		else {
+		} else {
 			ret = -EINVAL;
 			break;
 		}
#1 lore raw
Quoted 1 line · Federico Di Pierro

Hi!

Hello Federico.

Quoted 1 line

This is my latest task of the eudyptula challenge.

Your patch subject should be something like:

[PATCH] staging: iio: kernel style neatening

Quoted 2 lines

Just a very small patch! It fixes 3 little coding style problems. I'm using linux-next.

linux/drivers/staging/iio/frequency/ad9832.c
[]
@@ -73,7 +73,7 @@ static int ad9832_write_phase(struct ad9
}

static ssize_t ad9832_write(struct device *dev,
- struct device_attribute *attr,
+ struct device_attribute *attr,
const char *buf,
size_t len)

checkpatch is a brainless little tool.

Please make sure your own brain is engaged when
acting on or verifying any warnings it emits.

Please expand the indented line range to include
all the arguments of the function.

#2 lore raw
In reply to Federico Di Pierro
Quoted 4 lines · Federico Di Pierro

Hi!
This is my latest task of the eudyptula challenge.
Just a very small patch! It fixes 3 little coding style problems. I'm using linux-next.

Hi, Federico,

It's awesome you taking part in eudyptula challenge program. That is a good start
to kernel hacking.

But also please honour the community rule - the inline patch is preferred than in attachment form . Please have a look at Documentation/SubmittingPatches file in kernel source directory first before submitting patches.

Thanks,
Jianyu Zhan

maintainer
#3 lore raw
In reply to Federico Di Pierro
Quoted 4 lines · Federico Di Pierro

Hi!
This is my latest task of the eudyptula challenge.
Just a very small patch! It fixes 3 little coding style problems. I'm using linux-next.

Fair enough, but you need to spend a little time working on the 'how' of your patch submission.
See Documentation/SubmittingPatches and repost the patch according to those guidelines.

Also at a quick glance, unless I am very bored I'm unlikely to take such a minor white space and bracket adjustment patch. If it were part of a bigger series doing something more interesting I'd be more interested.

If you want to approach this driver, then feel free but there are many more major issues within it to be looked at such as ABI compliance. See Documentation/ABI/testing/sysfs-bus-iio and friends and compare the driver with them. Off the top of my head I can't remember how bad this driver is but I doubt everything is well documented.

Don't feel disheartened, as I would be happy to see more substantial cleanup patches from you as part of the challenge or otherwise.

Good luck,

Jonathan