mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Gokul K <gokul02k@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, Shuah Khan <shuah@kernel.org>,
	 linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] KVM: selftests: Delete the unused sparsebit copy and count helpers
Date: Fri, 18 Sep 2026 09:24:53 -0700	[thread overview]
Message-ID: <aq1l1WwdySbfX0qt@google.com> (raw)
In-Reply-To: <20260918113631.634233-2-gokul02k@gmail.com>

On Fri, Sep 18, 2026, Gokul K wrote:
> sparsebit_copy() and sparsebit_num_set() have no callers.  Nor does the
> FUZZ harness at the bottom of lib/sparsebit.c, which exercises most of
> the rest of the API and still builds and links with both removed.
> 
> sparsebit_copy() was the only non-recursive caller of
> node_copy_subtree(), which leaves that unreachable too.  It is static,
> so keeping it would trip -Wunused-function; delete it as well.
> 
> The comment on the num_set member gives sparsebit_num_set() as the
> reason the count is maintained.  The member stays - it is what lets
> sparsebit_all_set() answer in O(1), and the dump path prints it - so
> point the comment at what still uses it.
> 
> No functional change intended.
> 
> Signed-off-by: Gokul K <gokul02k@gmail.com>
> ---
>  .../testing/selftests/kvm/include/sparsebit.h |  2 -
>  tools/testing/selftests/kvm/lib/sparsebit.c   | 63 +------------------
>  2 files changed, 1 insertion(+), 64 deletions(-)
> 
> diff --git a/tools/testing/selftests/kvm/include/sparsebit.h b/tools/testing/selftests/kvm/include/sparsebit.h
> index e027e5790946..8a2ab11dae6f 100644
> --- a/tools/testing/selftests/kvm/include/sparsebit.h
> +++ b/tools/testing/selftests/kvm/include/sparsebit.h
> @@ -30,7 +30,6 @@ typedef u64 sparsebit_num_t;
>  
>  struct sparsebit *sparsebit_alloc(void);
>  void sparsebit_free(struct sparsebit **sbitp);
> -void sparsebit_copy(struct sparsebit *dstp, const struct sparsebit *src);

I'm somewhat tempted to keep sparsebit_copy() even though there are no users.
In the unlikely scenario someone wanted/needed to make a copy, it seems like a
potentially painful waste of time to have to recreate this or hunt down its prior
existence.

Anyone else have an opinion?

  reply	other threads:[~2026-09-18 16:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 11:36 [PATCH 0/3] KVM: selftests: Delete three pieces of dead library code Gokul K
2026-09-18 11:36 ` [PATCH 1/3] KVM: selftests: Delete the unused sparsebit copy and count helpers Gokul K
2026-09-18 16:24   ` Sean Christopherson [this message]
2026-09-18 11:36 ` [PATCH 2/3] KVM: selftests: Delete the declaration of vcpu_set_cpuid_maxphyaddr() Gokul K
2026-09-18 11:36 ` [PATCH 3/3] KVM: selftests: Delete the unused guest_snprintf() Gokul K
2026-09-18 16:05   ` Sean Christopherson

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=aq1l1WwdySbfX0qt@google.com \
    --to=seanjc@google.com \
    --cc=gokul02k@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=shuah@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®