* [PATCH v1] kernel: Add space before parenthesis and around '=', "==" and '<'
@ 2023-08-15 20:45 Atul Kumar Pant
2023-08-15 22:09 ` Paul Moore
0 siblings, 1 reply; 4+ messages in thread
From: Atul Kumar Pant @ 2023-08-15 20:45 UTC (permalink / raw)
To: paul, eparis; +Cc: Atul Kumar Pant, audit, linux-kernel, shuah
Fixes following checkpatch.pl issue:
ERROR: space required before the open parenthesis '('
ERROR: spaces required around that '='
ERROR: spaces required around that '<'
ERROR: spaces required around that '=='
Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com>
---
kernel/acct.c | 2 +-
kernel/auditfilter.c | 16 ++++++++--------
kernel/auditsc.c | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/kernel/acct.c b/kernel/acct.c
index 010667ce6080..c95a9359f209 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -470,7 +470,7 @@ static void fill_ac(acct_t *ac)
do_div(elapsed, AHZ);
btime = ktime_get_real_seconds() - elapsed;
ac->ac_btime = clamp_t(time64_t, btime, 0, U32_MAX);
-#if ACCT_VERSION==2
+#if ACCT_VERSION == 2
ac->ac_ahz = AHZ;
#endif
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index a25757f09255..8317a37dea0b 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -221,7 +221,7 @@ static int audit_match_signal(struct audit_entry *entry)
entry->rule.mask));
}
- switch(audit_classify_arch(arch->val)) {
+ switch (audit_classify_arch(arch->val)) {
case 0: /* native */
return (audit_match_class_bits(AUDIT_CLASS_SIGNAL,
entry->rule.mask));
@@ -243,7 +243,7 @@ static inline struct audit_entry *audit_to_entry_common(struct audit_rule_data *
err = -EINVAL;
listnr = rule->flags & ~AUDIT_FILTER_PREPEND;
- switch(listnr) {
+ switch (listnr) {
default:
goto exit_err;
#ifdef CONFIG_AUDITSYSCALL
@@ -344,7 +344,7 @@ static int audit_field_valid(struct audit_entry *entry, struct audit_field *f)
switch (entry->rule.listnr) {
case AUDIT_FILTER_FS:
- switch(f->type) {
+ switch (f->type) {
case AUDIT_FSTYPE:
case AUDIT_FILTERKEY:
break;
@@ -651,7 +651,7 @@ static struct audit_rule_data *audit_krule_to_data(struct audit_krule *krule)
data->fields[i] = f->type;
data->fieldflags[i] = audit_ops[f->op];
- switch(f->type) {
+ switch (f->type) {
case AUDIT_SUBJ_USER:
case AUDIT_SUBJ_ROLE:
case AUDIT_SUBJ_TYPE:
@@ -718,7 +718,7 @@ static int audit_compare_rule(struct audit_krule *a, struct audit_krule *b)
a->fields[i].op != b->fields[i].op)
return 1;
- switch(a->fields[i].type) {
+ switch (a->fields[i].type) {
case AUDIT_SUBJ_USER:
case AUDIT_SUBJ_ROLE:
case AUDIT_SUBJ_TYPE:
@@ -947,7 +947,7 @@ static inline int audit_add_rule(struct audit_entry *entry)
int dont_count = 0;
/* If any of these, don't count towards total */
- switch(entry->rule.listnr) {
+ switch (entry->rule.listnr) {
case AUDIT_FILTER_USER:
case AUDIT_FILTER_EXCLUDE:
case AUDIT_FILTER_FS:
@@ -1030,7 +1030,7 @@ int audit_del_rule(struct audit_entry *entry)
int dont_count = 0;
/* If any of these, don't count towards total */
- switch(entry->rule.listnr) {
+ switch (entry->rule.listnr) {
case AUDIT_FILTER_USER:
case AUDIT_FILTER_EXCLUDE:
case AUDIT_FILTER_FS:
@@ -1084,7 +1084,7 @@ static void audit_list_rules(int seq, struct sk_buff_head *q)
/* This is a blocking read, so use audit_filter_mutex instead of rcu
* iterator to sync with list writers. */
- for (i=0; i<AUDIT_NR_FILTERS; i++) {
+ for (i = 0; i < AUDIT_NR_FILTERS; i++) {
list_for_each_entry(r, &audit_rules_list[i], list) {
struct audit_rule_data *data;
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index addeed3df15d..a674039ea9ef 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -2124,7 +2124,7 @@ static void handle_path(const struct dentry *dentry)
d = dentry;
rcu_read_lock();
seq = read_seqbegin(&rename_lock);
- for(;;) {
+ for (;;) {
struct inode *inode = d_backing_inode(d);
if (inode && unlikely(inode->i_fsnotify_marks)) {
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1] kernel: Add space before parenthesis and around '=', "==" and '<'
2023-08-15 20:45 [PATCH v1] kernel: Add space before parenthesis and around '=', "==" and '<' Atul Kumar Pant
@ 2023-08-15 22:09 ` Paul Moore
2023-08-16 2:55 ` Atul Kumar Pant
0 siblings, 1 reply; 4+ messages in thread
From: Paul Moore @ 2023-08-15 22:09 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:
>
> Fixes following checkpatch.pl issue:
> ERROR: space required before the open parenthesis '('
> ERROR: spaces required around that '='
> ERROR: spaces required around that '<'
> ERROR: spaces required around that '=='
>
> Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com>
> ---
> kernel/acct.c | 2 +-
> kernel/auditfilter.c | 16 ++++++++--------
> kernel/auditsc.c | 2 +-
> 3 files changed, 10 insertions(+), 10 deletions(-)
I changed the subject line to "audit: add space before parenthesis and
around '=', "==", and '<'" as the "audit:" prefix is more appropriate
and I'm a believer of the Oxford Comma. Otherwise it looks fine and I
just merged it into audit/next, thanks.
--
paul-moore.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] kernel: Add space before parenthesis and around '=', "==" and '<'
2023-08-15 22:09 ` Paul Moore
@ 2023-08-16 2:55 ` Atul Kumar Pant
2023-08-16 13:38 ` Paul Moore
0 siblings, 1 reply; 4+ messages in thread
From: Atul Kumar Pant @ 2023-08-16 2:55 UTC (permalink / raw)
To: Paul Moore; +Cc: eparis, audit, linux-kernel, shuah
On Tue, Aug 15, 2023 at 06:09:19PM -0400, Paul Moore wrote:
> On Aug 15, 2023 Atul Kumar Pant <atulpant.linux@gmail.com> wrote:
> >
> > Fixes following checkpatch.pl issue:
> > ERROR: space required before the open parenthesis '('
> > ERROR: spaces required around that '='
> > ERROR: spaces required around that '<'
> > ERROR: spaces required around that '=='
> >
> > Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com>
> > ---
> > kernel/acct.c | 2 +-
> > kernel/auditfilter.c | 16 ++++++++--------
> > kernel/auditsc.c | 2 +-
> > 3 files changed, 10 insertions(+), 10 deletions(-)
>
> I changed the subject line to "audit: add space before parenthesis and
> around '=', "==", and '<'" as the "audit:" prefix is more appropriate
> and I'm a believer of the Oxford Comma. Otherwise it looks fine and I
> just merged it into audit/next, thanks.
Thank you for your comments. Do I need to change commit message now?
>
> --
> paul-moore.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] kernel: Add space before parenthesis and around '=', "==" and '<'
2023-08-16 2:55 ` Atul Kumar Pant
@ 2023-08-16 13:38 ` Paul Moore
0 siblings, 0 replies; 4+ messages in thread
From: Paul Moore @ 2023-08-16 13:38 UTC (permalink / raw)
To: Atul Kumar Pant; +Cc: eparis, audit, linux-kernel, shuah
On Tue, Aug 15, 2023 at 10:55 PM Atul Kumar Pant
<atulpant.linux@gmail.com> wrote:
> On Tue, Aug 15, 2023 at 06:09:19PM -0400, Paul Moore wrote:
> > On Aug 15, 2023 Atul Kumar Pant <atulpant.linux@gmail.com> wrote:
> > >
> > > Fixes following checkpatch.pl issue:
> > > ERROR: space required before the open parenthesis '('
> > > ERROR: spaces required around that '='
> > > ERROR: spaces required around that '<'
> > > ERROR: spaces required around that '=='
> > >
> > > Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com>
> > > ---
> > > kernel/acct.c | 2 +-
> > > kernel/auditfilter.c | 16 ++++++++--------
> > > kernel/auditsc.c | 2 +-
> > > 3 files changed, 10 insertions(+), 10 deletions(-)
> >
> > I changed the subject line to "audit: add space before parenthesis and
> > around '=', "==", and '<'" as the "audit:" prefix is more appropriate
> > and I'm a believer of the Oxford Comma. Otherwise it looks fine and I
> > just merged it into audit/next, thanks.
>
> Thank you for your comments. Do I need to change commit message now?
No, I fixed it up and merged the patch, it's just something to
remember for future patch submissions. Here is the commit in the
audit/next branch:
commit 62acadda115a94bffd1f6b36acbb67e3f04811be
Author: Atul Kumar Pant <atulpant.linux@gmail.com>
Date: Wed Aug 16 02:15:53 2023 +0530
audit: add space before parenthesis and around '=', "==", and '<'
Fixes following checkpatch.pl issue:
ERROR: space required before the open parenthesis '('
ERROR: spaces required around that '='
ERROR: spaces required around that '<'
ERROR: spaces required around that '=='
Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com>
[PM: subject line tweaks]
Signed-off-by: Paul Moore <paul@paul-moore.com>
--
paul-moore.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-08-16 13:38 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:45 [PATCH v1] kernel: Add space before parenthesis and around '=', "==" and '<' Atul Kumar Pant
2023-08-15 22:09 ` Paul Moore
2023-08-16 2:55 ` Atul Kumar Pant
2023-08-16 13:38 ` Paul Moore
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).