linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] kernel: auditsc: Removes use of assignment in if condition and moves open brace following function definitions to the next line.
@ 2023-08-15 20:46 Atul Kumar Pant
  2023-08-15 22:10 ` Paul Moore
  0 siblings, 1 reply; 4+ messages in thread
From: Atul Kumar Pant @ 2023-08-15 20:46 UTC (permalink / raw)
  To: paul, eparis; +Cc: Atul Kumar Pant, audit, linux-kernel, shuah

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

Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com>
---
 kernel/auditsc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index a674039ea9ef..d88ebc911277 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] kernel: auditsc: Removes use of assignment in if  condition and moves open brace following function definitions to the next  line.
  2023-08-15 20:46 [PATCH v1] kernel: auditsc: Removes use of assignment in if condition and moves open brace following function definitions to the next line Atul Kumar Pant
@ 2023-08-15 22:10 ` Paul Moore
  2023-08-15 22:14   ` Paul Moore
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Moore @ 2023-08-15 22:10 UTC (permalink / raw)
  To: Atul Kumar Pant, eparis; +Cc: Atul Kumar Pant, audit, linux-kernel, shuah

On Aug 15, 2023 Atul Kumar Pant <atulpant.linux@gmail.com> 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
> 
> Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com>
> ---
>  kernel/auditsc.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Merged into audit/next, thanks.

--
paul-moore.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] kernel: auditsc: Removes use of assignment in if condition and moves open brace following function definitions to the next line.
  2023-08-15 22:10 ` Paul Moore
@ 2023-08-15 22:14   ` Paul Moore
  2023-08-16  2:58     ` Atul Kumar Pant
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Moore @ 2023-08-15 22:14 UTC (permalink / raw)
  To: Atul Kumar Pant, eparis; +Cc: audit, linux-kernel, shuah

On Tue, Aug 15, 2023 at 6:10 PM Paul Moore <paul@paul-moore.com> wrote:
>
> On Aug 15, 2023 Atul Kumar Pant <atulpant.linux@gmail.com> 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
> >
> > Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com>
> > ---
> >  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.

-- 
paul-moore.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] kernel: auditsc: Removes use of assignment in if condition and moves open brace following function definitions to the next line.
  2023-08-15 22:14   ` Paul Moore
@ 2023-08-16  2:58     ` Atul Kumar Pant
  0 siblings, 0 replies; 4+ messages in thread
From: Atul Kumar Pant @ 2023-08-16  2:58 UTC (permalink / raw)
  To: Paul Moore; +Cc: eparis, audit, linux-kernel, shuah

On Tue, Aug 15, 2023 at 06:14:25PM -0400, Paul Moore wrote:
> On Tue, Aug 15, 2023 at 6:10 PM Paul Moore <paul@paul-moore.com> wrote:
> >
> > On Aug 15, 2023 Atul Kumar Pant <atulpant.linux@gmail.com> 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
> > >
> > > Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com>
> > > ---
> > >  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.
> 
	Thank you for the comments. I agree with your point on subject line
	and will follow your advice in my next patches.

> -- 
> paul-moore.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-16  2:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-15 20:46 [PATCH v1] kernel: auditsc: Removes use of assignment in if condition and moves open brace following function definitions to the next line Atul Kumar Pant
2023-08-15 22:10 ` Paul Moore
2023-08-15 22:14   ` Paul Moore
2023-08-16  2:58     ` Atul Kumar Pant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).