All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
	Michal Kubiak <michal.kubiak@intel.com>,
	Pavan Kumar Linga <pavan.kumar.linga@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v1] idpf: remove unreachable code from setting mailbox
Date: Fri, 11 Apr 2025 11:44:32 +0100	[thread overview]
Message-ID: <20250411104432.GZ395307@horms.kernel.org> (raw)
In-Reply-To: <20250409062945.1764245-1-michal.swiatkowski@linux.intel.com>

On Wed, Apr 09, 2025 at 08:29:45AM +0200, Michal Swiatkowski wrote:
> Remove code that isn't reached. There is no need to check for
> adapter->req_vec_chunks, because if it isn't set idpf_set_mb_vec_id()
> won't be called.
> 
> Only one path when idpf_set_mb_vec_id() is called:
> idpf_intr_req()
>  -> idpf_send_alloc_vectors_msg() -> adapter->req_vec_chunk is allocated
>  here, otherwise an error is returned and idpf_intr_req() exits with an
>  error.

I agree this is correct, but perhaps it would be clearer to say something
like this:

* idpf_set_mb_vec_id() is only called from idpf_intr_req()
* Before that idpf_intr_req() calls idpf_send_alloc_vectors_msg()
* idpf_send_alloc_vectors_msg() allocates adapter->req_vec_chunk

> 
> The idpf_set_mb_vec_id() becomes one-linear and it is called only once.

nit: one liner

> Remove it and set mailbox vector index directly.
> 
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
> Reviewed-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

The above notwithstanding, this looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>


WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <horms@kernel.org>
To: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
	Michal Kubiak <michal.kubiak@intel.com>,
	Pavan Kumar Linga <pavan.kumar.linga@intel.com>
Subject: Re: [PATCH iwl-next v1] idpf: remove unreachable code from setting mailbox
Date: Fri, 11 Apr 2025 11:44:32 +0100	[thread overview]
Message-ID: <20250411104432.GZ395307@horms.kernel.org> (raw)
In-Reply-To: <20250409062945.1764245-1-michal.swiatkowski@linux.intel.com>

On Wed, Apr 09, 2025 at 08:29:45AM +0200, Michal Swiatkowski wrote:
> Remove code that isn't reached. There is no need to check for
> adapter->req_vec_chunks, because if it isn't set idpf_set_mb_vec_id()
> won't be called.
> 
> Only one path when idpf_set_mb_vec_id() is called:
> idpf_intr_req()
>  -> idpf_send_alloc_vectors_msg() -> adapter->req_vec_chunk is allocated
>  here, otherwise an error is returned and idpf_intr_req() exits with an
>  error.

I agree this is correct, but perhaps it would be clearer to say something
like this:

* idpf_set_mb_vec_id() is only called from idpf_intr_req()
* Before that idpf_intr_req() calls idpf_send_alloc_vectors_msg()
* idpf_send_alloc_vectors_msg() allocates adapter->req_vec_chunk

> 
> The idpf_set_mb_vec_id() becomes one-linear and it is called only once.

nit: one liner

> Remove it and set mailbox vector index directly.
> 
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
> Reviewed-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

The above notwithstanding, this looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>


  reply	other threads:[~2025-04-11 10:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09  6:29 [Intel-wired-lan] [PATCH iwl-next v1] idpf: remove unreachable code from setting mailbox Michal Swiatkowski
2025-04-09  6:29 ` Michal Swiatkowski
2025-04-11 10:44 ` Simon Horman [this message]
2025-04-11 10:44   ` Simon Horman
2025-04-25 21:03   ` [Intel-wired-lan] " Salin, Samuel
2025-04-25 21:03     ` Salin, Samuel

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=20250411104432.GZ395307@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=aleksandr.loktionov@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=michal.kubiak@intel.com \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pavan.kumar.linga@intel.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 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.