Skip to contentSkip to conversation

Fixed Trivial Warnings in file: Deleted Spaces prior to tabs, and added lines. modified: kernel/auditfilter.c

PATCH In review Scott Matheina 4 participants 15 messages Oct 11, 2015 – Oct 27, 2015 Audit

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Fixed Trivial Warnings in file: Deleted Spaces prior to tabs, and added lines. modified: kernel/auditfilter.c

---
 kernel/auditfilter.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
kernel/auditfilter.c +10 -7
index 7714d93..774f9ad 100644
@@ -39,13 +39,13 @@
  * Locking model:
  *
  * audit_filter_mutex:
- * 		Synchronizes writes and blocking reads of audit's filterlist
- * 		data.  Rcu is used to traverse the filterlist and access
- * 		contents of structs audit_entry, audit_watch and opaque
- * 		LSM rules during filtering.  If modified, these structures
- * 		must be copied and replace their counterparts in the filterlist.
- * 		An audit_parent struct is not accessed during filtering, so may
- * 		be written directly provided audit_filter_mutex is held.
+ *		Synchronizes writes and blocking reads of audit's filterlist
+ *		data.  Rcu is used to traverse the filterlist and access
+ *		contents of structs audit_entry, audit_watch and opaque
+ *		LSM rules during filtering.  If modified, these structures
+ *		must be copied and replace their counterparts in the filterlist.
+ *		An audit_parent struct is not accessed during filtering, so may
+ *		be written directly provided audit_filter_mutex is held.
  */
 
 /* Audit filter lists, defined in <linux/audit.h> */
@@ -109,6 +109,7 @@ void audit_free_rule_rcu(struct rcu_head *head)
 {
 	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
 	audit_free_rule(e);
+
 }
 
 /* Initialize an audit filterlist entry. */
@@ -176,9 +177,11 @@ static __u32 *classes[AUDIT_SYSCALL_CLASSES];
 int __init audit_register_class(int class, unsigned *list)
 {
 	__u32 *p = kcalloc(AUDIT_BITMASK_SIZE, sizeof(__u32), GFP_KERNEL);
+
 	if (!p)
 		return -ENOMEM;
 	while (*list != ~0U) {
+
 		unsigned n = *list++;
 		if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
 			kfree(p);
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 4 lines · Scott Matheina
---
 kernel/auditfilter.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

Sorry for the delay in reviewing this, comments inline ...

Quoted 13 lines
kernel/auditfilter.c +0 -5
index 7714d93..774f9ad 100644
@@ -39,13 +39,13 @@
  * Locking model:
  *
  * audit_filter_mutex:
- * 		Synchronizes writes and blocking reads of audit's filterlist
- * 		data.  Rcu is used to traverse the filterlist and access
- * 		contents of structs audit_entry, audit_watch and opaque
- * 		LSM rules during filtering.  If modified, these structures
- * 		must be copied and replace their counterparts in the filterlist.

kernel/auditfilter.c line 49

Quoted 10 lines
kernel/auditfilter.c +7 -2
- * 		An audit_parent struct is not accessed during filtering, so may
- * 		be written directly provided audit_filter_mutex is held.
+ *		Synchronizes writes and blocking reads of audit's filterlist
+ *		data.  Rcu is used to traverse the filterlist and access
+ *		contents of structs audit_entry, audit_watch and opaque
+ *		LSM rules during filtering.  If modified, these structures
+ *		must be copied and replace their counterparts in the filterlist.
+ *		An audit_parent struct is not accessed during filtering, so may
+ *		be written directly provided audit_filter_mutex is held.
  */

Okay, that's fine.

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head) · line 113

Quoted 7 lines
kernel/auditfilter.c +1 -0
 /* Audit filter lists, defined in <linux/audit.h> */
@@ -109,6 +109,7 @@ void audit_free_rule_rcu(struct rcu_head *head)
 {
 	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
 	audit_free_rule(e);
+
 }

Why?

kernel/auditfilter.c static __u32 *classes[AUDIT_SYSCALL_CLASSES]; · line 182

Quoted 8 lines
kernel/auditfilter.c +1 -0
 /* Initialize an audit filterlist entry. */
@@ -176,9 +177,11 @@ static __u32 *classes[AUDIT_SYSCALL_CLASSES];
 int __init audit_register_class(int class, unsigned *list)
 {
 	__u32 *p = kcalloc(AUDIT_BITMASK_SIZE, sizeof(__u32), GFP_KERNEL);
+
 	if (!p)
 		return -ENOMEM;

Okay.

kernel/auditfilter.c static __u32 *classes[AUDIT_SYSCALL_CLASSES]; · line 187

Quoted 5 lines
kernel/auditfilter.c +1 -0
 	while (*list != ~0U) {
+
 		unsigned n = *list++;
 		if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
 			kfree(p);

Why?

Signature · 2 lines
paul moore
www.paul-moore.com
#2 lore raw
Quoted 32 lines · Paul Moore
Quoted 4 lines · Scott Matheina
---
 kernel/auditfilter.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

Sorry for the delay in reviewing this, comments inline ...

Quoted 13 lines
kernel/auditfilter.c +0 -5
index 7714d93..774f9ad 100644
@@ -39,13 +39,13 @@
  * Locking model:
  *
  * audit_filter_mutex:
- * 		Synchronizes writes and blocking reads of audit's filterlist
- * 		data.  Rcu is used to traverse the filterlist and access
- * 		contents of structs audit_entry, audit_watch and opaque
- * 		LSM rules during filtering.  If modified, these structures
- * 		must be copied and replace their counterparts in the filterlist.

kernel/auditfilter.c line 49

Quoted 10 lines
kernel/auditfilter.c +7 -2
- * 		An audit_parent struct is not accessed during filtering, so may
- * 		be written directly provided audit_filter_mutex is held.
+ *		Synchronizes writes and blocking reads of audit's filterlist
+ *		data.  Rcu is used to traverse the filterlist and access
+ *		contents of structs audit_entry, audit_watch and opaque
+ *		LSM rules during filtering.  If modified, these structures
+ *		must be copied and replace their counterparts in the filterlist.
+ *		An audit_parent struct is not accessed during filtering, so may
+ *		be written directly provided audit_filter_mutex is held.
  */

Okay, that's fine.

Quoted 8 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head) · line 113

Quoted 7 lines
kernel/auditfilter.c +1 -0
 /* Audit filter lists, defined in <linux/audit.h> */
@@ -109,6 +109,7 @@ void audit_free_rule_rcu(struct rcu_head *head)
 {
 	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
 	audit_free_rule(e);
+
 }

Why?

I was following the error messages in checkpatch.pl, but the warning went away after adding this line. No problem with the code.

Quoted 10 lines

kernel/auditfilter.c static __u32 *classes[AUDIT_SYSCALL_CLASSES]; · line 182

Quoted 8 lines
kernel/auditfilter.c +1 -0
 /* Initialize an audit filterlist entry. */
@@ -176,9 +177,11 @@ static __u32 *classes[AUDIT_SYSCALL_CLASSES];
 int __init audit_register_class(int class, unsigned *list)
 {
 	__u32 *p = kcalloc(AUDIT_BITMASK_SIZE, sizeof(__u32), GFP_KERNEL);
+
 	if (!p)
 		return -ENOMEM;

Okay.

Quoted 6 lines

kernel/auditfilter.c static __u32 *classes[AUDIT_SYSCALL_CLASSES]; · line 187

Quoted 5 lines
kernel/auditfilter.c +1 -0
 	while (*list != ~0U) {
+
 		unsigned n = *list++;
 		if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
 			kfree(p);

Why?

This is the same as above. Just going through the checkpatch.pl script, and looking for warnings to fix.

As you might have guessed, this is one of my first patches. I wasn't sure if a patch like this would even get reviewed, and responded to. I'm subscribed to the linux-kernel mail group, and seeing what is acceptable.

Thanks for the review. I don't plan on making a habit of submitting such incredibly trivial patches, but you have to start somewhere, and I thought it'd be hard to screw up by fixing a couple of trivial style errors.

#3 lore raw
Quoted 42 lines · Scott Matheina
Quoted 32 lines · Paul Moore
Quoted 4 lines · Scott Matheina
---
 kernel/auditfilter.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

Sorry for the delay in reviewing this, comments inline ...

Quoted 13 lines
kernel/auditfilter.c +0 -5
index 7714d93..774f9ad 100644
@@ -39,13 +39,13 @@
  * Locking model:
  *
  * audit_filter_mutex:
- * 		Synchronizes writes and blocking reads of audit's filterlist
- * 		data.  Rcu is used to traverse the filterlist and access
- * 		contents of structs audit_entry, audit_watch and opaque
- * 		LSM rules during filtering.  If modified, these structures
- * 		must be copied and replace their counterparts in the filterlist.

kernel/auditfilter.c line 49

Quoted 10 lines
kernel/auditfilter.c +7 -2
- * 		An audit_parent struct is not accessed during filtering, so may
- * 		be written directly provided audit_filter_mutex is held.
+ *		Synchronizes writes and blocking reads of audit's filterlist
+ *		data.  Rcu is used to traverse the filterlist and access
+ *		contents of structs audit_entry, audit_watch and opaque
+ *		LSM rules during filtering.  If modified, these structures
+ *		must be copied and replace their counterparts in the filterlist.
+ *		An audit_parent struct is not accessed during filtering, so may
+ *		be written directly provided audit_filter_mutex is held.
  */

Okay, that's fine.

Quoted 8 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head) · line 113

Quoted 7 lines
kernel/auditfilter.c +1 -0
 /* Audit filter lists, defined in <linux/audit.h> */
@@ -109,6 +109,7 @@ void audit_free_rule_rcu(struct rcu_head *head)
 {
 	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
 	audit_free_rule(e);
+
 }

Why?

Quoted 2 lines

I was following the error messages in checkpatch.pl, but the warning went away after adding this line. No problem with the code.

That sounds like a bug in checkpatch.pl, since that blank line should be tween the declaration and the function call.

Quoted 15 lines
Quoted 15 lines

kernel/auditfilter.c static __u32 *classes[AUDIT_SYSCALL_CLASSES]; · line 182

Quoted 8 lines
kernel/auditfilter.c +1 -0
 /* Initialize an audit filterlist entry. */
@@ -176,9 +177,11 @@ static __u32 *classes[AUDIT_SYSCALL_CLASSES];
 int __init audit_register_class(int class, unsigned *list)
 {
 	__u32 *p = kcalloc(AUDIT_BITMASK_SIZE, sizeof(__u32), GFP_KERNEL);
+
 	if (!p)
 		return -ENOMEM;

Okay.

Quoted 5 lines
kernel/auditfilter.c +1 -0
 	while (*list != ~0U) {
+
 		unsigned n = *list++;
 		if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
 			kfree(p);
Quoted 4 lines
Quoted 1 line

Why?

This is the same as above. Just going through the checkpatch.pl script, and looking for warnings to fix.

Again, another manifestation of that bug? That blank line should be after the declaration and before the if statement.

Quoted 9 lines

As you might have guessed, this is one of my first patches. I wasn't sure if a patch like this would even get reviewed, and responded to. I'm subscribed to the linux-kernel mail group, and seeing what is acceptable.

Thanks for the review. I don't plan on making a habit of submitting such incredibly trivial patches, but you have to start somewhere, and I thought it'd be hard to screw up by fixing a couple of trivial style errors.

Well, I agree, you have to start somewhere... Too bad you hit a bug in checkpatch.pl!

- RGB

--
Richard Guy Briggs <[email protected]>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545

#4 lore raw
Quoted 3 lines · Richard Guy Briggs
Quoted 2 lines · Scott Matheina
Quoted 1 line · Paul Moore

On Saturday, October 10, 2015 08:57:55 PM Scott Matheina wrote:

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

kernel/auditfilter.c

Quoted 1 line
kernel/auditfilter.c +0 -0

[]

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head) · line 113

Quoted 6 lines
kernel/auditfilter.c +1 -0
@@ -109,6 +109,7 @@ void audit_free_rule_rcu(struct rcu_head *head)
 {
 	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
 	audit_free_rule(e);
+
 }

Why?

Quoted 5 lines
Quoted 2 lines

I was following the error messages in checkpatch.pl, but the warning went away after adding this line. No problem with the code.

That sounds like a bug in checkpatch.pl, since that blank line should be tween the declaration and the function call.

checkpatch message asks for a blank line after the "struct audit_entry *e = ..." declaration.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
kernel/auditfilter.c +1 -0
 	while (*list != ~0U) {
+
 		unsigned n = *list++;
 		if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
 			kfree(p);
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Why?

This is the same as above. Just going through the checkpatch.pl script, and looking for warnings to fix.

Again, another manifestation of that bug? That blank line should be after the declaration and before the if statement.

[]

Quoted 2 lines

Well, I agree, you have to start somewhere... Too bad you hit a bug in checkpatch.pl!

Here too, not a bug in checkpatch.

checkpatch output asks for a blank line after the
"unsigned n" declaration, not before.

#5 lore raw
Quoted 15 lines · Joe Perches
Quoted 3 lines · Richard Guy Briggs
Quoted 2 lines · Scott Matheina
Quoted 1 line · Paul Moore

On Saturday, October 10, 2015 08:57:55 PM Scott Matheina wrote:

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

kernel/auditfilter.c

Quoted 1 line
kernel/auditfilter.c +0 -0

[]

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head) · line 113

Quoted 6 lines
kernel/auditfilter.c +1 -0
@@ -109,6 +109,7 @@ void audit_free_rule_rcu(struct rcu_head *head)
 {
 	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
 	audit_free_rule(e);
+
 }

Why?

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I was following the error messages in checkpatch.pl, but the warning went away after adding this line. No problem with the code.

That sounds like a bug in checkpatch.pl, since that blank line should be tween the declaration and the function call.

checkpatch message asks for a blank line after the "struct audit_entry *e = ..." declaration.

Well then maybe it is a bug in his interpretation of the output of checkpatch.pl? Scott, did you re-run checkpatch.pl after adding those spaces? Did it pass?

Quoted 12 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
kernel/auditfilter.c +1 -0
 	while (*list != ~0U) {
+
 		unsigned n = *list++;
 		if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
 			kfree(p);
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Why?

This is the same as above. Just going through the checkpatch.pl script, and looking for warnings to fix.

Again, another manifestation of that bug? That blank line should be after the declaration and before the if statement.

Quoted 8 lines

[]

Quoted 2 lines

Well, I agree, you have to start somewhere... Too bad you hit a bug in checkpatch.pl!

Here too, not a bug in checkpatch.

checkpatch output asks for a blank line after the
"unsigned n" declaration, not before.

- RGB

--
Richard Guy Briggs <[email protected]>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545

maintainer
#12 lore raw
In reply to Scott Matheina
Quoted 38 lines · Scott Matheina
Quoted 37 lines · Paul Moore
Quoted 5 lines · Scott Matheina

---

 kernel/auditfilter.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

Sorry for the delay in reviewing this, comments inline ...

Quoted 25 lines
kernel/auditfilter.c +7 -7
index 7714d93..774f9ad 100644
@@ -39,13 +39,13 @@
 
  * Locking model:
  *
 
  * audit_filter_mutex:
- * 		Synchronizes writes and blocking reads of audit's filterlist
- * 		data.  Rcu is used to traverse the filterlist and access
- * 		contents of structs audit_entry, audit_watch and opaque
- * 		LSM rules during filtering.  If modified, these structures
- * 		must be copied and replace their counterparts in the filterlist.
- * 		An audit_parent struct is not accessed during filtering, so may
- * 		be written directly provided audit_filter_mutex is held.
+ *		Synchronizes writes and blocking reads of audit's filterlist
+ *		data.  Rcu is used to traverse the filterlist and access
+ *		contents of structs audit_entry, audit_watch and opaque
+ *		LSM rules during filtering.  If modified, these structures
+ *		must be copied and replace their counterparts in the filterlist.
+ *		An audit_parent struct is not accessed during filtering, so may
+ *		be written directly provided audit_filter_mutex is held.
 
Quoted 1 line

*/

Okay, that's fine.

...

Quoted 7 lines

As you might have guessed, this is one of my first patches. I wasn't sure if a patch like this would even get reviewed, and responded to. I'm subscribed to the linux-kernel mail group, and seeing what is acceptable.

Thanks for the review. I don't plan on making a habit of submitting such incredibly trivial patches, but you have to start somewhere, and I thought it'd be hard to screw up by fixing a couple of trivial style errors.

We all start somewhere, and with that in mind, if you want to resubmit this patch with only the fix above (fixing the whitespace in the comment block), I'll apply it. While the patch is trivial, it is does fix a minor nit with near-zero risk.

I would encourage you to try something a bit more substantial next time, as they say, bug fixes are the quickest way to a maintainer's heart.

Signature · 2 lines
paul moore
www.paul-moore.com
#6 lore raw
In reply to Richard Guy Briggs
Quoted 17 lines · Richard Guy Briggs
Quoted 16 lines · Joe Perches
Quoted 3 lines · Richard Guy Briggs
Quoted 2 lines · Scott Matheina
Quoted 1 line · Paul Moore

On Saturday, October 10, 2015 08:57:55 PM Scott Matheina wrote:

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

kernel/auditfilter.c

Quoted 1 line
kernel/auditfilter.c +0 -0

[]

Quoted 9 lines
Quoted 9 lines
Quoted 7 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head) · line 113

Quoted 6 lines
kernel/auditfilter.c +1 -0
@@ -109,6 +109,7 @@ void audit_free_rule_rcu(struct rcu_head *head)
 {
 	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
 	audit_free_rule(e);
+
 }

Why?

I was following the error messages in checkpatch.pl, but the warning went away after adding this line. No problem with the code.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

That sounds like a bug in checkpatch.pl, since that blank line should be tween the declaration and the function call.

checkpatch message asks for a blank line after the "struct audit_entry *e = ..." declaration.

Well then maybe it is a bug in his interpretation of the output of checkpatch.pl? Scott, did you re-run checkpatch.pl after adding those spaces? Did it pass?

The error did go away.

Quoted 24 lines
Quoted 10 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

kernel/auditfilter.c static __u32 *classes[AUDIT_SYSCALL_CLASSES]; · line 187

Quoted 5 lines
kernel/auditfilter.c +1 -0
 	while (*list != ~0U) {
+
 		unsigned n = *list++;
 		if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
 			kfree(p);

Why?

This is the same as above. Just going through the checkpatch.pl script, and looking for warnings to fix.

Again, another manifestation of that bug? That blank line should be after the declaration and before the if statement.

Quoted 7 lines

[]

Quoted 2 lines

Well, I agree, you have to start somewhere... Too bad you hit a bug in checkpatch.pl!

Here too, not a bug in checkpatch.

checkpatch output asks for a blank line after the
"unsigned n" declaration, not before.

- RGB

--
Richard Guy Briggs <[email protected]>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545

#13 lore raw
In reply to Paul Moore
Quoted 46 lines · Paul Moore
Quoted 36 lines · Scott Matheina
Quoted 35 lines · Paul Moore
Quoted 5 lines · Scott Matheina

---

 kernel/auditfilter.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

Sorry for the delay in reviewing this, comments inline ...

Quoted 25 lines
kernel/auditfilter.c +7 -7
index 7714d93..774f9ad 100644
@@ -39,13 +39,13 @@
 
  * Locking model:
  *
 
  * audit_filter_mutex:
- * 		Synchronizes writes and blocking reads of audit's filterlist
- * 		data.  Rcu is used to traverse the filterlist and access
- * 		contents of structs audit_entry, audit_watch and opaque
- * 		LSM rules during filtering.  If modified, these structures
- * 		must be copied and replace their counterparts in the filterlist.
- * 		An audit_parent struct is not accessed during filtering, so may
- * 		be written directly provided audit_filter_mutex is held.
+ *		Synchronizes writes and blocking reads of audit's filterlist
+ *		data.  Rcu is used to traverse the filterlist and access
+ *		contents of structs audit_entry, audit_watch and opaque
+ *		LSM rules during filtering.  If modified, these structures
+ *		must be copied and replace their counterparts in the filterlist.
+ *		An audit_parent struct is not accessed during filtering, so may
+ *		be written directly provided audit_filter_mutex is held.
 
Quoted 1 line

*/

Okay, that's fine.

...

Quoted 7 lines

As you might have guessed, this is one of my first patches. I wasn't sure if a patch like this would even get reviewed, and responded to. I'm subscribed to the linux-kernel mail group, and seeing what is acceptable.

Thanks for the review. I don't plan on making a habit of submitting such incredibly trivial patches, but you have to start somewhere, and I thought it'd be hard to screw up by fixing a couple of trivial style errors.

Quoted 8 lines

We all start somewhere, and with that in mind, if you want to resubmit this patch with only the fix above (fixing the whitespace in the comment block), I'll apply it. While the patch is trivial, it is does fix a minor nit with near-zero risk.

I would encourage you to try something a bit more substantial next time, as they say, bug fixes are the quickest way to a maintainer's heart.

Thanks for the feedback. I'll resubmit. Now I get to figure out how to resubmit a patch with changes, so a good learning experience for me. Pure Hobbyist at this time, but I love to learn.

Scott

#7 lore raw
In reply to Scott Matheina
Quoted 20 lines · Scott Matheina
Quoted 19 lines · Richard Guy Briggs
Quoted 18 lines · Joe Perches
Quoted 3 lines · Richard Guy Briggs
Quoted 2 lines · Scott Matheina
Quoted 1 line · Paul Moore

On Saturday, October 10, 2015 08:57:55 PM Scott Matheina wrote:

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

kernel/auditfilter.c

Quoted 1 line
kernel/auditfilter.c +0 -0

[]

Quoted 11 lines
Quoted 9 lines
Quoted 7 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head) · line 113

Quoted 6 lines
kernel/auditfilter.c +1 -0
@@ -109,6 +109,7 @@ void audit_free_rule_rcu(struct rcu_head *head)
 {
 	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
 	audit_free_rule(e);
+
 }

Why?

I was following the error messages in checkpatch.pl, but the warning went away after adding this line. No problem with the code.

That sounds like a bug in checkpatch.pl, since that blank line should be tween the declaration and the function call.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

checkpatch message asks for a blank line after the "struct audit_entry *e = ..." declaration.

Well then maybe it is a bug in his interpretation of the output of checkpatch.pl? Scott, did you re-run checkpatch.pl after adding those spaces? Did it pass?

The error did go away.

Joe, I confirm the error went away. Looks like a bug in checkpatch.pl to me. I tried a number of combinations of things and it didn't complain about several things it should have. I did try a few other things to make sure it was still finding problems like brace placement and leading spaces, but it looks like the blank line checking code isn't working. This is on 4.0, so maybe it has been fixed since then. Scott, what kernel version are you using?

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head)

Quoted 5 lines
kernel/auditfilter.c +1 -0
 	while (*list != ~0U) {
+
 		unsigned n = *list++;
 		if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
 			kfree(p);

Why?

This is the same as above. Just going through the checkpatch.pl script, and looking for warnings to fix.

Again, another manifestation of that bug? That blank line should be after the declaration and before the if statement.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

[]

Quoted 2 lines

Well, I agree, you have to start somewhere... Too bad you hit a bug in checkpatch.pl!

Here too, not a bug in checkpatch.

checkpatch output asks for a blank line after the
"unsigned n" declaration, not before.

- RGB

- RGB

--
Richard Guy Briggs <[email protected]>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545

#8 lore raw
Quoted 26 lines · Richard Guy Briggs
Quoted 25 lines · Scott Matheina
Quoted 24 lines · Richard Guy Briggs
Quoted 14 lines · Joe Perches
Quoted 3 lines · Richard Guy Briggs
Quoted 2 lines · Scott Matheina
Quoted 1 line · Paul Moore

On Saturday, October 10, 2015 08:57:55 PM Scott Matheina wrote:

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

kernel/auditfilter.c

Quoted 1 line
kernel/auditfilter.c +0 -0

[]

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head) · line 113

Quoted 6 lines
kernel/auditfilter.c +1 -0
@@ -109,6 +109,7 @@ void audit_free_rule_rcu(struct rcu_head *head)
 {
 	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
 	audit_free_rule(e);
+
 }

Why?

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

I was following the error messages in checkpatch.pl, but the warning went away after adding this line. No problem with the code.

That sounds like a bug in checkpatch.pl, since that blank line should be tween the declaration and the function call.

checkpatch message asks for a blank line after the "struct audit_entry *e = ..." declaration.

Well then maybe it is a bug in his interpretation of the output of checkpatch.pl? Scott, did you re-run checkpatch.pl after adding those spaces? Did it pass?

Quoted 8 lines
Quoted 1 line

The error did go away.

Joe, I confirm the error went away. Looks like a bug in checkpatch.pl to me. I tried a number of combinations of things and it didn't complain about several things it should have. I did try a few other things to make sure it was still finding problems like brace placement and leading spaces, but it looks like the blank line checking code isn't working. This is on 4.0, so maybe it has been fixed since then. Scott, what kernel version are you using?

I'm running Ubuntu 14.04 LTS (Kernel 3.19.0-30-generic) on my machine.

I cloned Linus' repo for source code. I'm pretty sure you were talking about the active Kernel on my machine, so if not please let me know.

Quoted 26 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 9 lines
Quoted 7 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head)

Quoted 6 lines
kernel/auditfilter.c +1 -0
 	while (*list != ~0U) {
+
 		unsigned n = *list++;
 		if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
 			kfree(p);

Why?

This is the same as above. Just going through the checkpatch.pl script, and looking for warnings to fix.

Again, another manifestation of that bug? That blank line should be after the declaration and before the if statement.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

[]

Quoted 2 lines

Well, I agree, you have to start somewhere... Too bad you hit a bug in checkpatch.pl!

Here too, not a bug in checkpatch.

checkpatch output asks for a blank line after the
"unsigned n" declaration, not before.

- RGB

- RGB

--
Richard Guy Briggs <[email protected]>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545

#9 lore raw
Quoted 35 lines · Scott Matheina
Quoted 26 lines · Richard Guy Briggs
Quoted 25 lines · Scott Matheina
Quoted 24 lines · Richard Guy Briggs
Quoted 14 lines · Joe Perches
Quoted 3 lines · Richard Guy Briggs
Quoted 2 lines · Scott Matheina
Quoted 1 line · Paul Moore

On Saturday, October 10, 2015 08:57:55 PM Scott Matheina wrote:

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

kernel/auditfilter.c

Quoted 1 line
kernel/auditfilter.c +0 -0

[]

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head) · line 113

Quoted 6 lines
kernel/auditfilter.c +1 -0
@@ -109,6 +109,7 @@ void audit_free_rule_rcu(struct rcu_head *head)
 {
 	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
 	audit_free_rule(e);
+
 }

Why?

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

I was following the error messages in checkpatch.pl, but the warning went away after adding this line. No problem with the code.

That sounds like a bug in checkpatch.pl, since that blank line should be tween the declaration and the function call.

checkpatch message asks for a blank line after the "struct audit_entry *e = ..." declaration.

Well then maybe it is a bug in his interpretation of the output of checkpatch.pl? Scott, did you re-run checkpatch.pl after adding those spaces? Did it pass?

Quoted 8 lines
Quoted 1 line

The error did go away.

Joe, I confirm the error went away. Looks like a bug in checkpatch.pl to me. I tried a number of combinations of things and it didn't complain about several things it should have. I did try a few other things to make sure it was still finding problems like brace placement and leading spaces, but it looks like the blank line checking code isn't working. This is on 4.0, so maybe it has been fixed since then. Scott, what kernel version are you using?

Quoted 4 lines

I'm running Ubuntu 14.04 LTS (Kernel 3.19.0-30-generic) on my machine.

I cloned Linus' repo for source code. I'm pretty sure you were talking about the active Kernel on my machine, so if not please let me know.

I was talking about the source used to generate this patch in question, run ./scripts/checkpatch.pl and do a compile test. The active kernel on your machine is irrelevant unless you subsequently booted it to test it. How recent is your clone/pull of Linus' repo?

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head)

Quoted 5 lines
kernel/auditfilter.c +1 -0
 	while (*list != ~0U) {
+
 		unsigned n = *list++;
 		if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
 			kfree(p);

Why?

This is the same as above. Just going through the checkpatch.pl script, and looking for warnings to fix.

Again, another manifestation of that bug? That blank line should be after the declaration and before the if statement.

[]

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

Well, I agree, you have to start somewhere... Too bad you hit a bug in checkpatch.pl!

Here too, not a bug in checkpatch.

checkpatch output asks for a blank line after the
"unsigned n" declaration, not before.

- RGB

- RGB

- RGB

--
Richard Guy Briggs <[email protected]>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545

maintainer
#14 lore raw
In reply to Scott Matheina
Quoted 2 lines · Scott Matheina

Thanks for the feedback. I'll resubmit. Now I get to figure out how to resubmit a patch with changes, so a good learning experience for me. Pure Hobbyist at this time, but I love to learn.

If you haven't already, go read Documentation/SubmittingPatches in the kernel source, it will cover a lot of the basics. Also, as far as I'm concerned, the #1 absolutely most important thing you must always do when submitting patches is to make sure that I can simply save your email and apply it with patch, or import it directly via stgit/git/whatever; if I have to transform your patch in some way to get it to apply, I get grumpy, and I don't like to get grumpy.

Beyond that, good luck and have fun :)

Signature · 2 lines
paul moore
www.paul-moore.com
#10 lore raw
In reply to Richard Guy Briggs
Quoted 26 lines · Richard Guy Briggs
Quoted 25 lines · Scott Matheina
Quoted 24 lines · Richard Guy Briggs
Quoted 14 lines · Joe Perches
Quoted 3 lines · Richard Guy Briggs
Quoted 2 lines · Scott Matheina
Quoted 1 line · Paul Moore

On Saturday, October 10, 2015 08:57:55 PM Scott Matheina wrote:

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

kernel/auditfilter.c

Quoted 1 line
kernel/auditfilter.c +0 -0

[]

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head) · line 113

Quoted 6 lines
kernel/auditfilter.c +1 -0
@@ -109,6 +109,7 @@ void audit_free_rule_rcu(struct rcu_head *head)
  {
  	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
  	audit_free_rule(e);
+
  }

Why?

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

I was following the error messages in checkpatch.pl, but the warning went away after adding this line. No problem with the code.

That sounds like a bug in checkpatch.pl, since that blank line should be tween the declaration and the function call.

checkpatch message asks for a blank line after the "struct audit_entry *e = ..." declaration.

Well then maybe it is a bug in his interpretation of the output of checkpatch.pl? Scott, did you re-run checkpatch.pl after adding those spaces? Did it pass?

Quoted 8 lines
Quoted 1 line

The error did go away.

Joe, I confirm the error went away. Looks like a bug in checkpatch.pl to me. I tried a number of combinations of things and it didn't complain about several things it should have. I did try a few other things to make sure it was still finding problems like brace placement and leading spaces, but it looks like the blank line checking code isn't working. This is on 4.0, so maybe it has been fixed since then. Scott, what kernel version are you using?

I had just cloned Linus' repo, so v4.3rc6.

Quoted 26 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 9 lines
Quoted 7 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head)

Quoted 6 lines
kernel/auditfilter.c +1 -0
  	while (*list != ~0U) {
+
  		unsigned n = *list++;
  		if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
  			kfree(p);

Why?

This is the same as above. Just going through the checkpatch.pl script, and looking for warnings to fix.

Again, another manifestation of that bug? That blank line should be after the declaration and before the if statement.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

[]

Quoted 2 lines

Well, I agree, you have to start somewhere... Too bad you hit a bug in checkpatch.pl!

Here too, not a bug in checkpatch.

checkpatch output asks for a blank line after the
"unsigned n" declaration, not before.

- RGB

- RGB

--
Richard Guy Briggs <[email protected]>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545

#11 lore raw
In reply to Richard Guy Briggs
Quoted 23 lines · Richard Guy Briggs
Quoted 22 lines · Scott Matheina
Quoted 21 lines · Richard Guy Briggs
Quoted 20 lines · Joe Perches
Quoted 3 lines · Richard Guy Briggs
Quoted 2 lines · Scott Matheina
Quoted 1 line · Paul Moore

On Saturday, October 10, 2015 08:57:55 PM Scott Matheina wrote:

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

kernel/auditfilter.c

Quoted 1 line
kernel/auditfilter.c +0 -0

[]

Quoted 11 lines
Quoted 9 lines
Quoted 7 lines

kernel/auditfilter.c void audit_free_rule_rcu(struct rcu_head *head) · line 113

Quoted 6 lines
kernel/auditfilter.c +1 -0
@@ -109,6 +109,7 @@ void audit_free_rule_rcu(struct rcu_head *head)
 {
 	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
 	audit_free_rule(e);
+
 }

Why?

I was following the error messages in checkpatch.pl, but the warning went away after adding this line. No problem with the code.

That sounds like a bug in checkpatch.pl, since that blank line should be tween the declaration and the function call.

checkpatch message asks for a blank line after the "struct audit_entry *e = ..." declaration.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Well then maybe it is a bug in his interpretation of the output of checkpatch.pl? Scott, did you re-run checkpatch.pl after adding those spaces? Did it pass?

The error did go away.

Joe, I confirm the error went away. Looks like a bug in checkpatch.pl to me.

It's not a bug in checkpatch.

checkpatch doesn't care if there are blank lines between declarations.

Here's the output of checkpatch for this area:

WARNING: Missing a blank line after declarations
#111: FILE: kernel/auditfilter.c:111:
+ struct audit_entry *e = container_of(head, struct audit_entry, rcu);
+ audit_free_rule(e);

That doesn't suggest putting a blank line before line 111. It suggests putting a blank line after the declaration of e.