>-----Original Message-----
>From: Stephen Hemminger <step...@networkplumber.org>
>Sent: 23 July 2018 22:20
>To: Verma, Shally <shally.ve...@cavium.com>
>Cc: pablo.de.lara.gua...@intel.com; dev@dpdk.org; Athreya, Narayana Prasad 
><narayanaprasad.athr...@cavium.com>; Murthy,
>Nidadavolu <nidadavolu.mur...@cavium.com>; Sahu, Sunila 
><sunila.s...@cavium.com>; Gupta, Ashish
><ashish.gu...@cavium.com>
>Subject: Re: [dpdk-dev] [PATCH v5 1/3] crypto/openssl: add rsa and mod asym op
>
>External Email
>
>On Mon, 23 Jul 2018 20:16:03 +0530
>Shally Verma <shally.ve...@caviumnetworks.com> wrote:
>
>> +#define set_rsa_params(rsa, p, q, ret) \
>> +     do {rsa->p = p; rsa->q = q; ret = 0; } while (0)
>> +
>> +#define set_rsa_crt_params(rsa, dmp1, dmq1, iqmp, ret) \
>> +     do { \
>> +             rsa->dmp1 = dmp1; \
>> +             rsa->dmq1 = dmq1; \
>> +             rsa->iqmp = iqmp; \
>> +             ret = 0; \
>> +     } while (0)
>> +
>> +#define set_rsa_keys(rsa, n, e, d, ret) \
>> +     do { \
>> +             rsa->n = n; rsa->e = e; rsa->d = d; ret = 0; \
>> +     } while (0)
>> +
>> +#else
>> +
>> +#define set_rsa_params(rsa, p, q, ret) \
>> +     (ret = !RSA_set0_factors(rsa, p, q))
>> +
>> +#define set_rsa_crt_params(rsa, dmp1, dmq1, iqmp, ret) \
>> +     (ret = !RSA_set0_crt_params(rsa, dmp1, dmq1, iqmp))
>> +
>> +/* n, e must be non-null, d can be NULL */
>> +#define set_rsa_keys(rsa, n, e, d, ret) \
>> +     (ret = !RSA_set0_key(rsa, n, e, d))
>> +
>> +#endif /* version < 10100000 */
>> +
>> +#endif /* __RTA_COMPAT_H__ */
>
>Please use inline functions instead of macros.
>The crypto code seems to favor macros?
>
Since amount of code is very miniscule under each, so keeping as macro looked 
reasonable however, what goes in favour of inline than macros?

Thanks for feedback.
Shally

>Macro's have no type checking and are not faster anyway.

Reply via email to