> From: Akhil Goyal [mailto:gak...@marvell.com] > Sent: Thursday, 30 May 2024 13.02 > > ++ Morten for comment on #if vs #ifdef > > > > Subject: [EXTERNAL] [PATCH v2 1/2] crypto: fix build issues on unsetting > crypto > > > callbacks macro > > > > > > Crypto callbacks macro is defined with value 1 and being used with ifdef, > > > on config value is changed to 0 to disable, crypto callback changes > > > still being compiled. > > > > > > Used #if instead of #ifdef and also wrapped crypto callback changes > > > under RTE_CRYPTO_CALLBACKS macro to fix build issues when macro is > > > unset. > > > > > > Fixes: 1c3ffb95595e ("cryptodev: add enqueue and dequeue callbacks") > > > Fixes: 5523a75af539 ("test/crypto: add case for enqueue/dequeue > callbacks") > > > > > > Signed-off-by: Ganapati Kundapura <ganapati.kundap...@intel.com> > > > --- > > > v2: > > > * Used #if instead of #ifdef and restored macro definition in config > > > * Split callback registration check in a seperate patch
The DPDK convention is #ifdef, not #if. Ethdev also uses #ifdef, e.g.: https://elixir.bootlin.com/dpdk/v24.03/source/lib/ethdev/rte_ethdev.h#L6112 PS: Personally, I prefer #if too. But we should set personal preferences aside, and follow the existing convention in DPDK and use #ifdef.