Hi Ying,

Ok, I will remove that "ifdef ... else", I don't like it either, just worried 
about a compiler warning but I have tested & it is ok.
I think we can pass the node pointer to the "__dnode" anyway (don't need a 
NULL), so can remove the other "ifdef ... else" at every function calls (total 
= 8), do you agree?

BR/Tuong

-----Original Message-----
From: Ying Xue <[email protected]> 
Sent: Wednesday, November 6, 2019 3:42 PM
To: Tuong Lien <[email protected]>; 
[email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 4/5] tipc: introduce TIPC encryption & authentication

On 11/5/19 6:50 PM, Tuong Lien wrote:
>  void tipc_bearer_xmit(struct net *net, u32 bearer_id,
>                     struct sk_buff_head *xmitq,
> -                   struct tipc_media_addr *dst)
> +#ifdef CONFIG_TIPC_CRYPTO
> +                   struct tipc_media_addr *dst,
> +                   struct tipc_node *__dnode
> +#else
> +                   struct tipc_media_addr *dst
> +#endif
> +                   )

To make code simpler, I think we can directly add one new parameter (ie,
__dnode) no matter whether CONFIG_TIPC_CRYPTO is enabled or not.

When CONFIG_TIPC_CRYPTO is disabled, we just pass NULL to "__dnode"
parameter. As a consequence, we don't need to use CONFIG_TIPC_CRYPTO
config to separate the two different situations of whether
CONFIG_TIPC_CRYPTO is enabled or not whenever tipc_bearer_xmit() is called.



_______________________________________________
tipc-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to