+static int nbl_chan_init_msg_handler(struct nbl_channel_mgt *chan_mgt)
+{
+ struct nbl_common_info *common = chan_mgt->common;
+ struct nbl_hash_tbl_key tbl_key;
+ int ret = 0;
+
+ NBL_HASH_TBL_KEY_INIT(&tbl_key, common->dev, sizeof(u16),
+ sizeof(struct nbl_chan_msg_node_data),
+ NBL_CHAN_HANDLER_TBL_BUCKET_SIZE);
+#define NBL_HASH_TBL_KEY_INIT(key, dev_arg, key_size_arg, data_size_arg,\
+ bucket_size_arg) \
+do { \
+ typeof(key) __key = key; \
+ __key->dev = dev_arg; \
+ __key->key_size = key_size_arg; \
+ __key->data_size = data_size_arg; \
+ __key->bucket_size = bucket_size_arg; \
+ __key->resv = 0; \
+} while (0)
Why a macro? This could be a function. I don't see anything magical
here.
Andrew