public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Enze Li <enze.li@hotmail.com>
To: Luis Machado <luis.machado@arm.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH,obv] [AArch64] Remove unused struct
Date: Sat, 06 Aug 2022 15:39:20 +0800	[thread overview]
Message-ID: <OS3P286MB215292D4639E55817B1ABD2EF0619@OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20220805154800.48136-1-luis.machado@arm.com>

On Fri, 2022-08-05 at 16:48 +0100, Luis Machado via Gdb-patches wrote:
> While doing something else, I noticed struct sve_context is not used
> anywhere.
> 
> Remove it then.
> ---
>  gdb/nat/aarch64-sve-linux-sigcontext.h | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/gdb/nat/aarch64-sve-linux-sigcontext.h
> b/gdb/nat/aarch64-sve-linux-sigcontext.h
> index 1b40ffa8ee9..a166fbda7da 100644
> --- a/gdb/nat/aarch64-sve-linux-sigcontext.h
> +++ b/gdb/nat/aarch64-sve-linux-sigcontext.h
> @@ -21,12 +21,6 @@
>  
>  #define SVE_MAGIC      0x53564501
>  
> -struct sve_context {
> -       struct _aarch64_ctx head;
> -       __u16 vl;
> -       __u16 __reserved[3];
> -};
> -
>  /*
>   * The SVE architecture leaves space for future expansion of the
>   * vector length beyond its initial architectural limit of 2048 bits

Hi Luis,

With this patch applied, I use the following command to check,

$ grep -rn --exclude='ChangeLog*' 'sve_context' .

./gdb/nat/aarch64-sve-linux-sigcontext.h:48: * sve_context.head.size >=
./gdb/nat/aarch64-sve-linux-sigcontext.h:49:
*	SVE_SIG_CONTEXT_SIZE(sve_vq_from_vl(sve_context.vl))
./gdb/nat/aarch64-sve-linux-sigcontext.h:52: * If sve_context.head.size
<
./gdb/nat/aarch64-sve-linux-sigcontext.h:53:
*	SVE_SIG_CONTEXT_SIZE(sve_vq_from_vl(sve_context.vl)),
./gdb/nat/aarch64-sve-linux-sigcontext.h:59: * will need to remove or
resize the sve_context block if it wants to
./gdb/nat/aarch64-sve-linux-sigcontext.h:65: * sve_context.vl must
equal the thread's current vector length when
./gdb/nat/aarch64-sve-linux-sigcontext.h:74: * guaranteed for a struct
sve_context written by the kernel.
./gdb/nat/aarch64-sve-linux-sigcontext.h:79: * the start of struct
sve_context, and SVE_SIG_x_SIZE(args) is the
./gdb/nat/aarch64-sve-linux-sigcontext.h:102:	
((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1))
                ^^^^^^^^^^^
I noticed that struct sve_context is used here, which is eventually
used by SVE_SIG_CONTEXT_SIZE.  Although SVE_SIG_CONTEXT_SIZE is not
currently in use, it could cause a lot of unnecessary trouble once
someone uses it.

Other than that, there are still some comments that refer to struct
sve_context, please see above.  Maybe it's overkill, it would be nice
if you could deal with it.

Thanks,
Enze


  reply	other threads:[~2022-08-06  7:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05 15:48 Luis Machado
2022-08-06  7:39 ` Enze Li [this message]
2022-08-08  7:38   ` Luis Machado

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=OS3P286MB215292D4639E55817B1ABD2EF0619@OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM \
    --to=enze.li@hotmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado@arm.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).