public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Maxwell Doose <m32285159@gmail.com>
Cc: tsbogend@alpha.franken.de, gregkh@linuxfoundation.org,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-staging@lists.linux.dev
Subject: Re: [PATCH] mips: cavium-octeon: remove cmd queue state and related typedefs
Date: Fri, 17 Apr 2026 17:02:12 +0300	[thread overview]
Message-ID: <aeI9ZDPoP0apY92N@stanley.mountain> (raw)
In-Reply-To: <20260417023602.112359-1-m32285159@gmail.com>

On Thu, Apr 16, 2026 at 09:36:02PM -0500, Maxwell Doose wrote:
> diff --git a/arch/mips/include/asm/octeon/cvmx-cmd-queue.h b/arch/mips/include/asm/octeon/cvmx-cmd-queue.h
> index 67e1b2162b19..faef98173a4f 100644
> --- a/arch/mips/include/asm/octeon/cvmx-cmd-queue.h
> +++ b/arch/mips/include/asm/octeon/cvmx-cmd-queue.h
> @@ -71,6 +71,12 @@
>   *
>   */
>  
> +/* Global pointer to the state of command the queues
> + * Moved here to satisfy requirements in cvmx-cmd-queue.c for EXPORT_SYMBOL_GPL
> + */
> +extern struct __cvmx_cmd_queue_all_state
> +	    *__cvmx_cmd_queue_state_ptr;
> +

This is arch/mips/ and that's a different tree from staging with
different maintainers.  Generally, the rest of the kernel doesn't like
churn so I probably wouldn't send patches like this one for arch/mips/.

This comment isn't accurate.  This is a Sparse thing and nothing to do
with EXPORT_SYMBOL_GPL.

Normally we would decare variables like this in a header file, sure.
I guess the original authors wanted make absolutely sure no one ever
used this variable so they declared as an extern in
__cvmx_cmd_queue_state_ptr() __cvmx_cmd_queue_get_state().  It's unusual
and paranoid but I can't think of another reason why they would do it.
Generally, outside of staging, you just go along with whatever the
original author wanted.  They did the work after all, so they get to
decide.

This patch removes the declaration in __cvmx_cmd_queue_state_ptr() but
leaves it in __cvmx_cmd_queue_get_state().  We definitely can't do that.
And we can't mix this in with a remove typedefs patch.

regards,
dan carpenter

> @@ -234,10 +240,8 @@ static inline int __cvmx_cmd_queue_get_index(cvmx_cmd_queue_id_t queue_id)
>   * @qptr:     Pointer to the queue's global state
>   */
>  static inline void __cvmx_cmd_queue_lock(cvmx_cmd_queue_id_t queue_id,
> -					 __cvmx_cmd_queue_state_t *qptr)
> +					 struct __cvmx_cmd_queue_state *qptr)
>  {
> -	extern __cvmx_cmd_queue_all_state_t
> -	    *__cvmx_cmd_queue_state_ptr;
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

>  	int tmp;
>  	int my_ticket;
>  	prefetch(qptr);

[ snip]

> @@ -299,10 +303,10 @@ static inline void __cvmx_cmd_queue_unlock(__cvmx_cmd_queue_state_t *qptr)
>   *
>   * Returns Queue structure or NULL on failure
>   */
> -static inline __cvmx_cmd_queue_state_t
> +static inline struct __cvmx_cmd_queue_state
>      *__cvmx_cmd_queue_get_state(cvmx_cmd_queue_id_t queue_id)
>  {
> -	extern __cvmx_cmd_queue_all_state_t
> +	extern struct __cvmx_cmd_queue_all_state
>  	    *__cvmx_cmd_queue_state_ptr;
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

>  	return &__cvmx_cmd_queue_state_ptr->
>  	    state[__cvmx_cmd_queue_get_index(queue_id)];


  parent reply	other threads:[~2026-04-17 14:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-17  2:36 [PATCH] mips: cavium-octeon: remove cmd queue state and related typedefs Maxwell Doose
2026-04-17  5:25 ` Dan Carpenter
2026-04-17 13:16   ` Maxwell Doose
2026-04-17 14:02 ` Dan Carpenter [this message]
2026-04-17 14:45   ` Maxwell Doose

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=aeI9ZDPoP0apY92N@stanley.mountain \
    --to=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=m32285159@gmail.com \
    --cc=tsbogend@alpha.franken.de \
    /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