On Fri, Oct 25, 2024 at 09:58:05AM +0300, Dan Carpenter wrote:
> Hello Paul E. McKenney,
> 
> Commit 1e07186d7377 ("refscale: Add srcu_read_lock_lite() support
> using "srcu-lite"") from Oct 15, 2024 (linux-next), leads to the
> following Smatch static checker warning:
> 
>       kernel/rcu/refscale.c:1151 ref_scale_init()
>       warn: inconsistent indenting
> 
> kernel/rcu/refscale.c
>     1141         for (i = 0; i < ARRAY_SIZE(scale_ops); i++) {
>     1142                 cur_ops = scale_ops[i]; if (strcmp(scale_type,
>     1143                 cur_ops->name) == 0)
>     1144                         break;
>     1145         }
>     1146         if (i == ARRAY_SIZE(scale_ops)) {
>     1147                 pr_alert("rcu-scale: invalid scale type: \"%s\"\n",
>     1148                 scale_type); pr_alert("rcu-scale types:"); for (i = 
> 0;
>     1149                 i < ARRAY_SIZE(scale_ops); i++)
>     1150                         pr_cont(" %s", scale_ops[i]->name);
> --> 1151                 pr_cont("\n"); firsterr = -EINVAL; cur_ops = NULL;
>     1152                 goto unwind;
> 
> This looks like you pressed the wrong button in vim and it accidentally 
> jumbled
> the code?
> 
>     1153         }
>     1154         if (cur_ops->init)
>     1155                 if (!cur_ops->init()) {
>     1156                         firsterr = -EUCLEAN;
>     1157                         goto unwind;
>     1158                 }

Excellent guess!!!  :-(

How about the following?

                                                        Thanx, Paul

------------------------------------------------------------------------

commit a489ef720efa78763afa39fe88d09dbb4176a47d
Author: Paul E. McKenney <paul...@kernel.org>
Date:   Fri Oct 25 17:55:29 2024 -0700

    refscale: Undo j/J vim mistake in ref_scale_init()
    
    This commit gives each of three statements a line of their own.
    
    Reported-by: Dan Carpenter <dan.carpen...@linaro.org>
    Signed-off-by: Paul E. McKenney <paul...@kernel.org>

diff --git a/kernel/rcu/refscale.c b/kernel/rcu/refscale.c
index 7770e202d1ea1..7e6472a86dba8 100644
--- a/kernel/rcu/refscale.c
+++ b/kernel/rcu/refscale.c
@@ -1182,7 +1182,9 @@ ref_scale_init(void)
                scale_type); pr_alert("rcu-scale types:"); for (i = 0;
                i < ARRAY_SIZE(scale_ops); i++)
                        pr_cont(" %s", scale_ops[i]->name);
-               pr_cont("\n"); firsterr = -EINVAL; cur_ops = NULL;
+               pr_cont("\n");
+               firsterr = -EINVAL;
+               cur_ops = NULL;
                goto unwind;
        }
        if (cur_ops->init)

Reply via email to