Re: [PATCH 4/4] IB/isert: the kill ->isert_cmd back pointer in the struct iser_tx_desc

Max Gurtovoy
2016-02-17T09:31:31Z

Hi,

On 2/15/2016 10:11 PM, Christoph Hellwig wrote:
> We only use the pointer when processing regular iSER commands, and it then
> always points to the struct iser_cmd that contains the TX descriptor.
>
> Remove it and rely on container_of to save a little space and avoid a
> pointer that is updated multiple times per processed command.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/infiniband/ulp/isert/ib_isert.c | 14 ++++++--------
> drivers/infiniband/ulp/isert/ib_isert.h | 1 -
> 2 files changed, 6 insertions(+), 9 deletions(-)
>

maybe we can define it once as:
static inline struct isert_cmd *
isert_tx_to_cmd(iser_tx_desc *tx_desc)
{
return container_of(tx_desc, struct isert_cmd, tx_desc);
}
in the .h file ?

cheers,
Max.