From: Johannes Berg Date: Thu, 12 Nov 2015 15:16:01 +0000 (+0100) Subject: iwlwifi: trans: make various conversion macros inlines X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=85e5a3876393484361db8ae8d43b1bc27b8ad9c2;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git iwlwifi: trans: make various conversion macros inlines Make the various conversion functions typesafe, so we don't accidentally try to call them with the wrong pointers and cast them to something that will crash. Signed-off-by: Johannes Berg Signed-off-by: Emmanuel Grumbach --- diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h index bf8cb59097ea..bf41543996a8 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h +++ b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h @@ -378,8 +378,11 @@ struct iwl_trans_pcie { u32 fw_mon_size; }; -#define IWL_TRANS_GET_PCIE_TRANS(_iwl_trans) \ - ((struct iwl_trans_pcie *) ((_iwl_trans)->trans_specific)) +static inline struct iwl_trans_pcie * +IWL_TRANS_GET_PCIE_TRANS(struct iwl_trans *trans) +{ + return (void *)trans->trans_specific; +} static inline struct iwl_trans * iwl_trans_pcie_get_trans(struct iwl_trans_pcie *trans_pcie)