kernel: auditsc: Removes use of assignment in if condition and moves open brace following function definitions to the next line.
PATCH 1/1 kernel: auditsc: Removes use of assignment in if condition and moves open brace following function definitions to the next line.
The patch fixes following checkpatch.pl issue:
ERROR: open brace '{' following function definitions go on the next line
ERROR: do not use assignment in if condition
--- kernel/auditsc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/auditsc.c +4 -2
@@ -880,7 +880,8 @@ static void audit_filter_syscall(struct task_struct *tsk,*/ static int audit_filter_inode_name (struct task_struct *tsk,struct audit_names *n, -struct audit_context *ctx) { +struct audit_context *ctx) +{int h =audit_hash_ino ((u32 )n->ino);struct list_head *list = &audit_inode_hash[h];
@@ -1064,7 +1065,8 @@ int audit_alloc(struct task_struct *tsk)return 0 ; } -if (!(context =audit_alloc_context (state))) { + context =audit_alloc_context (state); +if (!context) {kfree (key);audit_log_lost ("out of memory in audit_alloc" );return -ENOMEM ;
Signature · 1 line
2.25.1
Quoted 9 lines · On Aug 15, 2023 Atul Kumar Pant <[email protected]> wrote:
The patch fixes following checkpatch.pl issue:
ERROR: open brace '{' following function definitions go on the next line
ERROR: do not use assignment in if conditionSigned-off-by Atul Kumar Pant <[email protected]>--- kernel/auditsc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Merged into audit/next, thanks.
--
paul-moore.com
Paul Moore
maintainerQuoted 7 lines · Paul Moore
Quoted 5 lines · On Aug 15, 2023 Atul Kumar Pant <[email protected]> wrote:
The patch fixes following checkpatch.pl issue:
ERROR: open brace '{' following function definitions go on the next line
ERROR: do not use assignment in if condition
Quoted 6 lines
Quoted 4 lines
Signed-off-by Atul Kumar Pant <[email protected]>--- kernel/auditsc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)Merged into audit/next, thanks.
I also wanted to say that I changed the subject line to "audit:
cleanup function braces and assignment-in-if-condition", what you had written was far too long for a subject line. A subject line should be brief and does not need to be a full sentence, in fact it probably should *not* be a full sentence.
Signature · 1 line
paul-moore.com
Quoted 13 lines · Paul Moore
Quoted 12 lines · Paul Moore
Quoted 9 lines · On Aug 15, 2023 Atul Kumar Pant <[email protected]> wrote:
The patch fixes following checkpatch.pl issue:
ERROR: open brace '{' following function definitions go on the next line
ERROR: do not use assignment in if conditionSigned-off-by Atul Kumar Pant <[email protected]>--- kernel/auditsc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 8 lines
Quoted 1 line
Merged into audit/next, thanks.
I also wanted to say that I changed the subject line to "audit:
cleanup function braces and assignment-in-if-condition", what you had written was far too long for a subject line. A subject line should be brief and does not need to be a full sentence, in fact it probably should *not* be a full sentence.
Thank you for the comments. I agree with your point on subject line and will follow your advice in my next patches.
Quoted 2 lines
Signature · 1 line
paul-moore.com