All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ariel Otilibili-Anieli" <Ariel.Otilibili-Anieli@eurecom.fr>
To: "Jan Beulich" <jbeulich@suse.com>
Cc: "Doug Goldstein" <cardoe@cardoe.com>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH 2/2] xen/tools: remove dead code
Date: Tue, 24 Dec 2024 15:51:51 +0100	[thread overview]
Message-ID: <2f7a8b-676aca80-518b-be99fc0@193695621> (raw)
In-Reply-To: <c25666d7-f485-4cb3-9f30-d5f6ea58857a@suse.com>

On Tuesday, December 24, 2024 09:43 CET, Jan Beulich <jbeulich@suse.com> wrote:

> On 20.12.2024 17:55, Ariel Otilibili wrote:
> > Default switch case exits directly; these instructions are never reached.
> > 
> > The file was taken from Linux; the copies have diverged a lot since:
> > 
> > ```
> > $ diff -u xen/xen/tools/kconfig/expr.c linux/scripts/kconfig/expr.c | wc -l
> > 984
> > ```
> > 
> > Therefore the change is only applied locally.
> > 
> > Coverity-ID: 1458052
> > Fixes: 8c271b7584 ("build: import Kbuild/Kconfig from Linux 4.3")
> > Signed-off-by: Ariel Otilibili <Ariel.Otilibili-Anieli@eurecom.fr>
> 
> As the title of the commit referenced already clarifies - this is once
> again code we took from elsewhere, so imo wants updating at the origin
> first. Then import that commit into Xen.

Indeed, Jan; thanks for the feedback. I am pushing a new series for this hunk; it was fixed in Linux.
I think in commits dfe8e56fc604 ("kconfig: add fallthrough comments to expr_compare_type()"), & 9ad86d747c46 ("kconfig: remove unreachable printf()").

```
$ diff -u xen/xen/tools/kconfig/expr.c linux/scripts/kconfig/expr.c | sed -ne '/expr_compare_type/,/return 0/{N;p}'
 static int expr_compare_type(enum expr_type t1, enum expr_type t2)
 {
        if (t1 == t2)
@@ -1106,30 +999,27 @@
        case E_GTH:
                if (t2 == E_EQUAL || t2 == E_UNEQUAL)
                        return 1;
+               /* fallthrough */
        case E_EQUAL:
        case E_UNEQUAL:
                if (t2 == E_NOT)
                        return 1;
+               /* fallthrough */
        case E_NOT:
                if (t2 == E_AND)
                        return 1;
+               /* fallthrough */
        case E_AND:
                if (t2 == E_OR)
                        return 1;
-       case E_OR:
-               if (t2 == E_LIST)
-                       return 1;
-       case E_LIST:
-               if (t2 == 0)
-                       return 1;
+               /* fallthrough */
        default:
-               return -1;
+               break;
        }
-       printf("[%dgt%d?]", t1, t2);
        return 0;
 }

$ cd linux/; 
$ git log --oneline -1 --pretty='%h ("%s")'
8155b4ef3466 ("Add linux-next specific files for 20241220")
$ git remote -v 
next    git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git (fetch)
next    git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git (push)

$ cd ../xen/
$ git log --oneline -1 --pretty='%h ("%s")'
6419020270 ("CHANGELOG: Mention LLC coloring feature on Arm")

$ git remote -v 
up      git://xenbits.xen.org/xen.git (fetch)
up      git://xenbits.xen.org/xen.git (push)
```
> 
> Jan



  reply	other threads:[~2024-12-24 14:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-20 16:55 [PATCH 0/2] tools/libs,xen/tools: remove dead code Ariel Otilibili
2024-12-20 16:55 ` [PATCH 1/2] tools/libs: " Ariel Otilibili
2024-12-20 16:55 ` [PATCH 2/2] xen/tools: " Ariel Otilibili
2024-12-24  8:43   ` Jan Beulich
2024-12-24 14:51     ` Ariel Otilibili-Anieli [this message]
2024-12-24 19:13 ` [PATCH v2 0/2] tools/libs,xen/tools: " Ariel Otilibili
2024-12-24 19:13   ` [PATCH v2 1/2] tools/libs: " Ariel Otilibili
2025-01-08 10:15     ` Anthony PERARD
2024-12-24 19:13   ` [PATCH v2 2/2] xen/tools: " Ariel Otilibili
2024-12-27  9:30     ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f7a8b-676aca80-518b-be99fc0@193695621 \
    --to=ariel.otilibili-anieli@eurecom.fr \
    --cc=cardoe@cardoe.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.