From: Luca Coelho <luca@coelho.fi>
To: linux-wireless@vger.kernel.org
Cc: kvalo@codeaurora.org, Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 21/25] iwlwifi: remove unnecessary dev_cmd_headroom parameter
Date: Tue, 11 Apr 2017 15:37:38 +0300 [thread overview]
Message-ID: <20170411123742.12214-22-luca@coelho.fi> (raw)
In-Reply-To: <20170411123742.12214-1-luca@coelho.fi>
From: Luca Coelho <luciano.coelho@intel.com>
We don't need this parameter anymore, since we always pass 0 anyway.
Remove it from the structure and from all the relevant functions.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
drivers/net/wireless/intel/iwlwifi/iwl-trans.c | 7 ++-----
drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 17 +++++------------
drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 2 +-
3 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
index d42cab291025..0bde26bab15d 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
@@ -70,8 +70,7 @@
struct iwl_trans *iwl_trans_alloc(unsigned int priv_size,
struct device *dev,
const struct iwl_cfg *cfg,
- const struct iwl_trans_ops *ops,
- size_t dev_cmd_headroom)
+ const struct iwl_trans_ops *ops)
{
struct iwl_trans *trans;
#ifdef CONFIG_LOCKDEP
@@ -90,15 +89,13 @@ struct iwl_trans *iwl_trans_alloc(unsigned int priv_size,
trans->dev = dev;
trans->cfg = cfg;
trans->ops = ops;
- trans->dev_cmd_headroom = dev_cmd_headroom;
trans->num_rx_queues = 1;
snprintf(trans->dev_cmd_pool_name, sizeof(trans->dev_cmd_pool_name),
"iwl_cmd_pool:%s", dev_name(trans->dev));
trans->dev_cmd_pool =
kmem_cache_create(trans->dev_cmd_pool_name,
- sizeof(struct iwl_device_cmd)
- + trans->dev_cmd_headroom,
+ sizeof(struct iwl_device_cmd),
sizeof(void *),
SLAB_HWCACHE_ALIGN,
NULL);
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
index b52804dd884f..1b4b62ede2c4 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
@@ -772,9 +772,6 @@ enum iwl_plat_pm_mode {
* the transport must set this before calling iwl_drv_start()
* @dev_cmd_pool: pool for Tx cmd allocation - for internal use only.
* The user should use iwl_trans_{alloc,free}_tx_cmd.
- * @dev_cmd_headroom: room needed for the transport's private use before the
- * device_cmd for Tx - for internal use only
- * The user should use iwl_trans_{alloc,free}_tx_cmd.
* @rx_mpdu_cmd: MPDU RX command ID, must be assigned by opmode before
* starting the firmware, used for tracing
* @rx_mpdu_cmd_hdr_size: used for tracing, amount of data before the
@@ -825,7 +822,6 @@ struct iwl_trans {
/* The following fields are internal only */
struct kmem_cache *dev_cmd_pool;
- size_t dev_cmd_headroom;
char dev_cmd_pool_name[50];
struct dentry *dbgfs_dir;
@@ -998,13 +994,13 @@ iwl_trans_dump_data(struct iwl_trans *trans,
static inline struct iwl_device_cmd *
iwl_trans_alloc_tx_cmd(struct iwl_trans *trans)
{
- u8 *dev_cmd_ptr = kmem_cache_alloc(trans->dev_cmd_pool, GFP_ATOMIC);
+ struct iwl_device_cmd *dev_cmd_ptr =
+ kmem_cache_alloc(trans->dev_cmd_pool, GFP_ATOMIC);
if (unlikely(dev_cmd_ptr == NULL))
return NULL;
- return (struct iwl_device_cmd *)
- (dev_cmd_ptr + trans->dev_cmd_headroom);
+ return dev_cmd_ptr;
}
int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd);
@@ -1012,9 +1008,7 @@ int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd);
static inline void iwl_trans_free_tx_cmd(struct iwl_trans *trans,
struct iwl_device_cmd *dev_cmd)
{
- u8 *dev_cmd_ptr = (u8 *)dev_cmd - trans->dev_cmd_headroom;
-
- kmem_cache_free(trans->dev_cmd_pool, dev_cmd_ptr);
+ kmem_cache_free(trans->dev_cmd_pool, dev_cmd);
}
static inline int iwl_trans_tx(struct iwl_trans *trans, struct sk_buff *skb,
@@ -1237,8 +1231,7 @@ static inline void iwl_trans_fw_error(struct iwl_trans *trans)
struct iwl_trans *iwl_trans_alloc(unsigned int priv_size,
struct device *dev,
const struct iwl_cfg *cfg,
- const struct iwl_trans_ops *ops,
- size_t dev_cmd_headroom);
+ const struct iwl_trans_ops *ops);
void iwl_trans_free(struct iwl_trans *trans);
/*****************************************************
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 15bf5100d096..b362779b66f4 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -2948,7 +2948,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
return ERR_PTR(ret);
trans = iwl_trans_alloc(sizeof(struct iwl_trans_pcie),
- &pdev->dev, cfg, &trans_ops_pcie, 0);
+ &pdev->dev, cfg, &trans_ops_pcie);
if (!trans)
return ERR_PTR(-ENOMEM);
--
2.11.0
next prev parent reply other threads:[~2017-04-11 12:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-11 12:37 [PATCH 00/25] iwlwifi: updates intended for v4.12 2017-04-11 Luca Coelho
2017-04-11 12:37 ` [PATCH 01/25] iwlwifi: mvm: support new binding API Luca Coelho
2017-04-11 12:37 ` [PATCH 02/25] iwlwifi: be more verbose about needed firmware Luca Coelho
2017-04-11 12:37 ` [PATCH 03/25] iwlwifi: mvm: add DQA_ENABLE_CMD to the command list Luca Coelho
2017-04-11 12:37 ` [PATCH 04/25] iwlwifi: remove support for deprecated RF Luca Coelho
2017-04-11 12:37 ` [PATCH 05/25] iwlwifi: mvm: bump max API to 30 Luca Coelho
2017-04-11 12:37 ` [PATCH 06/25] iwlwifi: mvm: adjust new API of compressed BA Luca Coelho
2017-04-11 12:37 ` [PATCH 07/25] iwlwifi: mvm: fix RX SKB header size and align it properly Luca Coelho
2017-04-11 12:37 ` [PATCH 08/25] iwlwifi: pcie: print less data upon firmware crash Luca Coelho
2017-04-11 12:37 ` [PATCH 09/25] iwlwifi: mvm: cleanup pending frames in DQA mode Luca Coelho
2017-04-11 12:37 ` [PATCH 10/25] iwlwifi: use upper_32_bits/lower_32_bits where appropriate Luca Coelho
2017-04-11 12:37 ` [PATCH 11/25] iwlwifi: add support for 9000 HW B-step NICs Luca Coelho
2017-04-11 12:37 ` [PATCH 12/25] iwlwifi: mvm: add multicast station Luca Coelho
2017-04-11 12:37 ` [PATCH 13/25] iwlwifi: mvm: support new ADD_MODIFY_STA_KEY command Luca Coelho
2017-04-11 12:37 ` [PATCH 14/25] iwlwifi: mvm: optimize reorder timeout frame releasing Luca Coelho
2017-04-11 12:37 ` [PATCH 15/25] iwlwifi: mvm: don't assume static queue numbers Luca Coelho
2017-04-11 12:37 ` [PATCH 16/25] Revert "iwlwifi: introduce trans API to get byte count table" Luca Coelho
2017-04-11 12:37 ` [PATCH 17/25] iwlwifi: pcie: remove the active field in struct iwl_txq Luca Coelho
2017-04-11 12:37 ` [PATCH 18/25] iwlwifi: pcie: use WFPM_GP for debugging D3 flows Luca Coelho
2017-04-11 12:37 ` [PATCH 19/25] iwlwifi: pcie: use iwl_get_dma_hi_addr() Luca Coelho
2017-04-11 12:37 ` [PATCH 20/25] iwlwifi: mvm: support MFUART dump in case of MFUART assert Luca Coelho
2017-04-11 12:37 ` Luca Coelho [this message]
2017-04-11 12:37 ` [PATCH 22/25] iwlwifi: pcie: introduce split point to a000 devices Luca Coelho
2017-04-11 12:37 ` [PATCH 23/25] iwlwifi: pcie: add context information support Luca Coelho
2017-04-11 12:37 ` [PATCH 24/25] iwlwifi: mvm: remove call for paging in new init flow Luca Coelho
2017-04-11 12:37 ` [PATCH 25/25] iwlwifi: mvm: separate queue mapping from queue enablement Luca Coelho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170411123742.12214-22-luca@coelho.fi \
--to=luca@coelho.fi \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luciano.coelho@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).