linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs: scrub: remove unnecessary braces and fix
@ 2025-07-19  5:22 or10n-cli
  2025-07-19  5:29 ` Darrick J. Wong
  2025-07-19  8:33 ` [PATCH] xfs: scrub: remove unnecessary braces and fix … Markus Elfring
  0 siblings, 2 replies; 4+ messages in thread
From: or10n-cli @ 2025-07-19  5:22 UTC (permalink / raw)
  To: cem, djwong; +Cc: linux-xfs, linux-kernel

 From b8e455b79c84b4e1501ea554327672b6d391d35d Mon Sep 17 00:00:00 2001
From: or10n-cli <muhammad.ahmed.27@hotmail.com>
Date: Sat, 19 Jul 2025 10:10:42 +0500
Subject: [PATCH] xfs: scrub: remove unnecessary braces and fix 
indentation in
  findparent.c

This patch removes unnecessary braces around simple if-else blocks and
fixes inconsistent indentation in fs/xfs/scrub/findparent.c to comply
with kernel coding style guidelines.

All changes are verified using checkpatch.pl with no warnings or errors.

Signed-off-by: Muhammad Ahmed <muhammad.ahmed.27@hotmail.com>
---
  fs/xfs/scrub/findparent.c | 9 +++------
  1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/fs/xfs/scrub/findparent.c b/fs/xfs/scrub/findparent.c
index 84487072b6dd..9a2f25c7c2e3 100644
--- a/fs/xfs/scrub/findparent.c
+++ b/fs/xfs/scrub/findparent.c
@@ -229,15 +229,12 @@ xrep_findparent_live_update(
          */
         if (p->ip->i_ino == sc->ip->i_ino &&
             xchk_iscan_want_live_update(&pscan->iscan, p->dp->i_ino)) {
-               if (p->delta > 0) {
+               if (p->delta > 0)
                         xrep_findparent_scan_found(pscan, p->dp->i_ino);
-               } else {
+               else
                         xrep_findparent_scan_found(pscan, NULLFSINO);
-               }
         }
-
         return NOTIFY_DONE;
-}

  /*
   * Set up a scan to find the parent of a directory.  The provided 
dirent hook
@@ -386,7 +383,7 @@ xrep_findparent_confirm(

         /* Reject garbage parent inode numbers and self-referential 
parents. */
         if (*parent_ino == NULLFSINO)
-              return 0;
+               return 0;
         if (!xfs_verify_dir_ino(sc->mp, *parent_ino) ||
             *parent_ino == sc->ip->i_ino) {
                 *parent_ino = NULLFSINO;
--
2.47.2

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

* Re: [PATCH] xfs: scrub: remove unnecessary braces and fix
  2025-07-19  5:22 [PATCH] xfs: scrub: remove unnecessary braces and fix or10n-cli
@ 2025-07-19  5:29 ` Darrick J. Wong
  2025-07-19  6:05   ` Carlos Maiolino
  2025-07-19  8:33 ` [PATCH] xfs: scrub: remove unnecessary braces and fix … Markus Elfring
  1 sibling, 1 reply; 4+ messages in thread
From: Darrick J. Wong @ 2025-07-19  5:29 UTC (permalink / raw)
  To: or10n-cli; +Cc: cem, linux-xfs, linux-kernel

On Sat, Jul 19, 2025 at 10:22:09AM +0500, or10n-cli wrote:
> From b8e455b79c84b4e1501ea554327672b6d391d35d Mon Sep 17 00:00:00 2001
> From: or10n-cli <muhammad.ahmed.27@hotmail.com>

WTF is "orion-cli" ?

> Date: Sat, 19 Jul 2025 10:10:42 +0500
> Subject: [PATCH] xfs: scrub: remove unnecessary braces and fix indentation
> in
>  findparent.c
> 
> This patch removes unnecessary braces around simple if-else blocks and
> fixes inconsistent indentation in fs/xfs/scrub/findparent.c to comply
> with kernel coding style guidelines.
> 
> All changes are verified using checkpatch.pl with no warnings or errors.
> 
> Signed-off-by: Muhammad Ahmed <muhammad.ahmed.27@hotmail.com>
> ---
>  fs/xfs/scrub/findparent.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/xfs/scrub/findparent.c b/fs/xfs/scrub/findparent.c
> index 84487072b6dd..9a2f25c7c2e3 100644
> --- a/fs/xfs/scrub/findparent.c
> +++ b/fs/xfs/scrub/findparent.c
> @@ -229,15 +229,12 @@ xrep_findparent_live_update(
>          */
>         if (p->ip->i_ino == sc->ip->i_ino &&
>             xchk_iscan_want_live_update(&pscan->iscan, p->dp->i_ino)) {
> -               if (p->delta > 0) {
> +               if (p->delta > 0)
>                         xrep_findparent_scan_found(pscan, p->dp->i_ino);
> -               } else {
> +               else
>                         xrep_findparent_scan_found(pscan, NULLFSINO);
> -               }
>         }
> -
>         return NOTIFY_DONE;
> -}

DID YOU EVEN COMPILE THIS???

--D

>  /*
>   * Set up a scan to find the parent of a directory.  The provided dirent
> hook
> @@ -386,7 +383,7 @@ xrep_findparent_confirm(
> 
>         /* Reject garbage parent inode numbers and self-referential parents.
> */
>         if (*parent_ino == NULLFSINO)
> -              return 0;
> +               return 0;
>         if (!xfs_verify_dir_ino(sc->mp, *parent_ino) ||
>             *parent_ino == sc->ip->i_ino) {
>                 *parent_ino = NULLFSINO;
> --
> 2.47.2
> 

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

* Re: [PATCH] xfs: scrub: remove unnecessary braces and fix
  2025-07-19  5:29 ` Darrick J. Wong
@ 2025-07-19  6:05   ` Carlos Maiolino
  0 siblings, 0 replies; 4+ messages in thread
From: Carlos Maiolino @ 2025-07-19  6:05 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: or10n-cli, linux-xfs, linux-kernel

On Fri, Jul 18, 2025 at 10:29:16PM -0700, Darrick J. Wong wrote:
> On Sat, Jul 19, 2025 at 10:22:09AM +0500, or10n-cli wrote:
> > From b8e455b79c84b4e1501ea554327672b6d391d35d Mon Sep 17 00:00:00 2001
> > From: or10n-cli <muhammad.ahmed.27@hotmail.com>
> 
> WTF is "orion-cli" ?

No clue, but those 'patches' are going to my spam-list from now on...

> 
> > Date: Sat, 19 Jul 2025 10:10:42 +0500
> > Subject: [PATCH] xfs: scrub: remove unnecessary braces and fix indentation
> > in
> >  findparent.c
> >
> > This patch removes unnecessary braces around simple if-else blocks and
> > fixes inconsistent indentation in fs/xfs/scrub/findparent.c to comply
> > with kernel coding style guidelines.
> >
> > All changes are verified using checkpatch.pl with no warnings or errors.
> >
> > Signed-off-by: Muhammad Ahmed <muhammad.ahmed.27@hotmail.com>
> > ---
> >  fs/xfs/scrub/findparent.c | 9 +++------
> >  1 file changed, 3 insertions(+), 6 deletions(-)
> >
> > diff --git a/fs/xfs/scrub/findparent.c b/fs/xfs/scrub/findparent.c
> > index 84487072b6dd..9a2f25c7c2e3 100644
> > --- a/fs/xfs/scrub/findparent.c
> > +++ b/fs/xfs/scrub/findparent.c
> > @@ -229,15 +229,12 @@ xrep_findparent_live_update(
> >          */
> >         if (p->ip->i_ino == sc->ip->i_ino &&
> >             xchk_iscan_want_live_update(&pscan->iscan, p->dp->i_ino)) {
> > -               if (p->delta > 0) {
> > +               if (p->delta > 0)
> >                         xrep_findparent_scan_found(pscan, p->dp->i_ino);
> > -               } else {
> > +               else
> >                         xrep_findparent_scan_found(pscan, NULLFSINO);
> > -               }
> >         }
> > -
> >         return NOTIFY_DONE;
> > -}
> 
> DID YOU EVEN COMPILE THIS???

I'll stop wasting time on patches from this sender.

And just for the *fun* of it... checkpatch.pl fails on this patch...


> 
> --D
> 
> >  /*
> >   * Set up a scan to find the parent of a directory.  The provided dirent
> > hook
> > @@ -386,7 +383,7 @@ xrep_findparent_confirm(
> >
> >         /* Reject garbage parent inode numbers and self-referential parents.
> > */
> >         if (*parent_ino == NULLFSINO)
> > -              return 0;
> > +               return 0;
> >         if (!xfs_verify_dir_ino(sc->mp, *parent_ino) ||
> >             *parent_ino == sc->ip->i_ino) {
> >                 *parent_ino = NULLFSINO;
> > --
> > 2.47.2
> >
> 

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

* Re: [PATCH] xfs: scrub: remove unnecessary braces and fix …
  2025-07-19  5:22 [PATCH] xfs: scrub: remove unnecessary braces and fix or10n-cli
  2025-07-19  5:29 ` Darrick J. Wong
@ 2025-07-19  8:33 ` Markus Elfring
  1 sibling, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2025-07-19  8:33 UTC (permalink / raw)
  To: Muhammad Ahmed, linux-xfs; +Cc: LKML, Carlos Maiolino, Darrick J. Wong

> This patch removes unnecessary braces around simple if-else blocks and

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16-rc6#n94


How do you think about to use the following code variant?

		xrep_findparent_scan_found(pscan, p->delta > 0 ? p->dp->i_ino : NULLFSINO);


> fixes inconsistent indentation in fs/xfs/scrub/findparent.c to comply
> with kernel coding style guidelines.

Please split possible changes into separate update steps.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16-rc6#n81

Regards,
Markus

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

end of thread, other threads:[~2025-07-19  8:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-19  5:22 [PATCH] xfs: scrub: remove unnecessary braces and fix or10n-cli
2025-07-19  5:29 ` Darrick J. Wong
2025-07-19  6:05   ` Carlos Maiolino
2025-07-19  8:33 ` [PATCH] xfs: scrub: remove unnecessary braces and fix … Markus Elfring

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).