Re: [PATCH net-next v8 03/10] net/smc: unify the structs of accept or confirm message for v1 and v2

Alexandra Winter
2023-12-20T10:28:01Z

On 19.12.23 15:26, Wen Gu wrote:
> The structs of CLC accept and confirm messages for SMCv1 and SMCv2 are
> separately defined and often casted to each other in the code, which may
> increase the risk of errors caused by future divergence of them. So
> unify them into one struct for better maintainability.
>
> Suggested-by: Alexandra Winter <wintera@linux.ibm.com>
> Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
> ---
> net/smc/af_smc.c | 52 +++++++++++++------------------------
> net/smc/smc_clc.c | 65 ++++++++++++++++++++---------------------------
> net/smc/smc_clc.h | 42 +++++++++++++-----------------
> 3 files changed, 62 insertions(+), 97 deletions(-)

Thanks a lot Wen Gu, I really love this.
Using an unnamed union is a great solution here. Now the code is so much more
readable and maintainable

Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>