[Intel-wired-lan] [PATCH iwl-next v1] idpf: remove unreachable code from setting mailbox

Simon Horman horms at kernel.org
Fri Apr 11 10:44:32 UTC 2025


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 at intel.com>
> Reviewed-by: Michal Kubiak <michal.kubiak at intel.com>
> Reviewed-by: Pavan Kumar Linga <pavan.kumar.linga at intel.com>
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski at linux.intel.com>

The above notwithstanding, this looks good to me.

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



More information about the Intel-wired-lan mailing list