Linux-Wireless Archive mirror
 help / color / mirror / Atom feed
From: Jerome Pouiller <Jerome.Pouiller@silabs.com>
To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Kalle Valo" <kvalo@codeaurora.org>,
	"David S . Miller" <davem@davemloft.net>,
	"Jérôme Pouiller" <jerome.pouiller@silabs.com>
Subject: [PATCH 19/31] staging: wfx: prefix structs tx_policy and hwbus_ops with wfx_
Date: Thu, 13 Jan 2022 09:55:12 +0100	[thread overview]
Message-ID: <20220113085524.1110708-20-Jerome.Pouiller@silabs.com> (raw)
In-Reply-To: <20220113085524.1110708-1-Jerome.Pouiller@silabs.com>

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

All the types related to a driver should use the same prefix.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/bus.h      |  2 +-
 drivers/staging/wfx/bus_sdio.c |  2 +-
 drivers/staging/wfx/bus_spi.c  |  2 +-
 drivers/staging/wfx/data_tx.c  | 38 +++++++++++++++++-----------------
 drivers/staging/wfx/data_tx.h  | 10 ++++-----
 drivers/staging/wfx/hif_rx.c   |  4 ++--
 drivers/staging/wfx/main.c     |  2 +-
 drivers/staging/wfx/main.h     |  4 ++--
 drivers/staging/wfx/wfx.h      |  6 +++---
 9 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/wfx/bus.h b/drivers/staging/wfx/bus.h
index ca04b3da6204..91b5a545b8ff 100644
--- a/drivers/staging/wfx/bus.h
+++ b/drivers/staging/wfx/bus.h
@@ -20,7 +20,7 @@
 #define WFX_REG_SET_GEN_R_W   0x6
 #define WFX_REG_FRAME_OUT     0x7
 
-struct hwbus_ops {
+struct wfx_hwbus_ops {
 	int (*copy_from_io)(void *bus_priv, unsigned int addr,
 			    void *dst, size_t count);
 	int (*copy_to_io)(void *bus_priv, unsigned int addr,
diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c
index 42aeab30bf0a..abcb507a48b3 100644
--- a/drivers/staging/wfx/bus_sdio.c
+++ b/drivers/staging/wfx/bus_sdio.c
@@ -159,7 +159,7 @@ static size_t wfx_sdio_align_size(void *priv, size_t size)
 	return sdio_align_size(bus->func, size);
 }
 
-static const struct hwbus_ops wfx_sdio_hwbus_ops = {
+static const struct wfx_hwbus_ops wfx_sdio_hwbus_ops = {
 	.copy_from_io = wfx_sdio_copy_from_io,
 	.copy_to_io = wfx_sdio_copy_to_io,
 	.irq_subscribe = wfx_sdio_irq_subscribe,
diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c
index 55ffcd7c42e2..99d33a128830 100644
--- a/drivers/staging/wfx/bus_spi.c
+++ b/drivers/staging/wfx/bus_spi.c
@@ -168,7 +168,7 @@ static size_t wfx_spi_align_size(void *priv, size_t size)
 	return ALIGN(size, 4);
 }
 
-static const struct hwbus_ops wfx_spi_hwbus_ops = {
+static const struct wfx_hwbus_ops wfx_spi_hwbus_ops = {
 	.copy_from_io = wfx_spi_copy_from_io,
 	.copy_to_io = wfx_spi_copy_to_io,
 	.irq_subscribe = wfx_spi_irq_subscribe,
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index c004f455bb47..fec30d773e62 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -44,7 +44,7 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev,
 
 /* TX policy cache implementation */
 
-static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy,
+static void wfx_tx_policy_build(struct wfx_vif *wvif, struct wfx_tx_policy *policy,
 				struct ieee80211_tx_rate *rates)
 {
 	struct wfx_dev *wdev = wvif->wdev;
@@ -66,16 +66,16 @@ static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy,
 	}
 }
 
-static bool wfx_tx_policy_is_equal(const struct tx_policy *a,
-				   const struct tx_policy *b)
+static bool wfx_tx_policy_is_equal(const struct wfx_tx_policy *a,
+				   const struct wfx_tx_policy *b)
 {
 	return !memcmp(a->rates, b->rates, sizeof(a->rates));
 }
 
-static int wfx_tx_policy_find(struct tx_policy_cache *cache,
-			      struct tx_policy *wanted)
+static int wfx_tx_policy_find(struct wfx_tx_policy_cache *cache,
+			      struct wfx_tx_policy *wanted)
 {
-	struct tx_policy *it;
+	struct wfx_tx_policy *it;
 
 	list_for_each_entry(it, &cache->used, link)
 		if (wfx_tx_policy_is_equal(wanted, it))
@@ -86,15 +86,15 @@ static int wfx_tx_policy_find(struct tx_policy_cache *cache,
 	return -1;
 }
 
-static void wfx_tx_policy_use(struct tx_policy_cache *cache,
-			      struct tx_policy *entry)
+static void wfx_tx_policy_use(struct wfx_tx_policy_cache *cache,
+			      struct wfx_tx_policy *entry)
 {
 	++entry->usage_count;
 	list_move(&entry->link, &cache->used);
 }
 
-static int wfx_tx_policy_release(struct tx_policy_cache *cache,
-				 struct tx_policy *entry)
+static int wfx_tx_policy_release(struct wfx_tx_policy_cache *cache,
+				 struct wfx_tx_policy *entry)
 {
 	int ret = --entry->usage_count;
 
@@ -107,9 +107,9 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif,
 			     struct ieee80211_tx_rate *rates, bool *renew)
 {
 	int idx;
-	struct tx_policy_cache *cache = &wvif->tx_policy_cache;
-	struct tx_policy wanted;
-	struct tx_policy *entry;
+	struct wfx_tx_policy_cache *cache = &wvif->tx_policy_cache;
+	struct wfx_tx_policy wanted;
+	struct wfx_tx_policy *entry;
 
 	wfx_tx_policy_build(wvif, &wanted, rates);
 
@@ -127,7 +127,7 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif,
 		 * entry in "free" list
 		 */
 		*renew = true;
-		entry = list_entry(cache->free.prev, struct tx_policy, link);
+		entry = list_entry(cache->free.prev, struct wfx_tx_policy, link);
 		memcpy(entry->rates, wanted.rates, sizeof(entry->rates));
 		entry->uploaded = false;
 		entry->usage_count = 0;
@@ -143,7 +143,7 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif,
 static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx)
 {
 	int usage, locked;
-	struct tx_policy_cache *cache = &wvif->tx_policy_cache;
+	struct wfx_tx_policy_cache *cache = &wvif->tx_policy_cache;
 
 	if (idx == HIF_TX_RETRY_POLICY_INVALID)
 		return;
@@ -157,7 +157,7 @@ static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx)
 
 static int wfx_tx_policy_upload(struct wfx_vif *wvif)
 {
-	struct tx_policy *policies = wvif->tx_policy_cache.cache;
+	struct wfx_tx_policy *policies = wvif->tx_policy_cache.cache;
 	u8 tmp_rates[12];
 	int i, is_used;
 
@@ -192,7 +192,7 @@ void wfx_tx_policy_upload_work(struct work_struct *work)
 
 void wfx_tx_policy_init(struct wfx_vif *wvif)
 {
-	struct tx_policy_cache *cache = &wvif->tx_policy_cache;
+	struct wfx_tx_policy_cache *cache = &wvif->tx_policy_cache;
 	int i;
 
 	memset(cache, 0, sizeof(*cache));
@@ -435,8 +435,8 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
 
 static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb)
 {
-	struct wfx_hif_msg *hif = (struct hif_msg *)skb->data;
-	struct wfx_hif_req_tx *req = (struct hif_req_tx *)hif->body;
+	struct wfx_hif_msg *hif = (struct wfx_hif_msg *)skb->data;
+	struct wfx_hif_req_tx *req = (struct wfx_hif_req_tx *)hif->body;
 	unsigned int offset = sizeof(struct wfx_hif_msg) +
 			      sizeof(struct wfx_hif_req_tx) +
 			      req->fc_offset;
diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h
index c901a03ee4d8..040f731e62ae 100644
--- a/drivers/staging/wfx/data_tx.h
+++ b/drivers/staging/wfx/data_tx.h
@@ -18,15 +18,15 @@ struct wfx_tx_priv;
 struct wfx_dev;
 struct wfx_vif;
 
-struct tx_policy {
+struct wfx_tx_policy {
 	struct list_head link;
 	int usage_count;
 	u8 rates[12];
 	bool uploaded;
 };
 
-struct tx_policy_cache {
-	struct tx_policy cache[HIF_TX_RETRY_POLICY_MAX];
+struct wfx_tx_policy_cache {
+	struct wfx_tx_policy cache[HIF_TX_RETRY_POLICY_MAX];
 	/* FIXME: use a trees and drop hash from tx_policy */
 	struct list_head used;
 	struct list_head free;
@@ -59,8 +59,8 @@ static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb)
 
 static inline struct wfx_hif_req_tx *wfx_skb_txreq(struct sk_buff *skb)
 {
-	struct wfx_hif_msg *hif = (struct hif_msg *)skb->data;
-	struct wfx_hif_req_tx *req = (struct hif_req_tx *)hif->body;
+	struct wfx_hif_msg *hif = (struct wfx_hif_msg *)skb->data;
+	struct wfx_hif_req_tx *req = (struct wfx_hif_req_tx *)hif->body;
 
 	return req;
 }
diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index f2564a20bdcf..2073ac43bebd 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -110,7 +110,7 @@ static int wfx_hif_receive_indication(struct wfx_dev *wdev,
 			 __func__, hif->interface);
 		return -EIO;
 	}
-	skb_pull(skb, sizeof(struct wfx_hif_msg) + sizeof(struct hif_ind_rx));
+	skb_pull(skb, sizeof(struct wfx_hif_msg) + sizeof(struct wfx_hif_ind_rx));
 	wfx_rx_cb(wvif, body, skb);
 
 	return 0;
@@ -380,7 +380,7 @@ static const struct {
 void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
 {
 	int i;
-	const struct wfx_hif_msg *hif = (const struct hif_msg *)skb->data;
+	const struct wfx_hif_msg *hif = (const struct wfx_hif_msg *)skb->data;
 	int hif_id = hif->id;
 
 	if (hif_id == HIF_IND_ID_RX) {
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index f34cfed503d4..7b9d75f219fb 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -262,7 +262,7 @@ static void wfx_free_common(void *data)
 
 struct wfx_dev *wfx_init_common(struct device *dev,
 				const struct wfx_platform_data *pdata,
-				const struct hwbus_ops *hwbus_ops,
+				const struct wfx_hwbus_ops *hwbus_ops,
 				void *hwbus_priv)
 {
 	struct ieee80211_hw *hw;
diff --git a/drivers/staging/wfx/main.h b/drivers/staging/wfx/main.h
index 115abd2d4378..68a7807c5fb6 100644
--- a/drivers/staging/wfx/main.h
+++ b/drivers/staging/wfx/main.h
@@ -16,7 +16,7 @@
 #include "hif_api_general.h"
 
 struct wfx_dev;
-struct hwbus_ops;
+struct wfx_hwbus_ops;
 
 struct wfx_platform_data {
 	/* Keyset and ".sec" extension will be appended to this string */
@@ -31,7 +31,7 @@ struct wfx_platform_data {
 
 struct wfx_dev *wfx_init_common(struct device *dev,
 				const struct wfx_platform_data *pdata,
-				const struct hwbus_ops *hwbus_ops,
+				const struct wfx_hwbus_ops *hwbus_ops,
 				void *hwbus_priv);
 
 int wfx_probe(struct wfx_dev *wdev);
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 1c06430e5996..189b96cd3d13 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -25,7 +25,7 @@
 #define USEC_PER_TXOP 32 /* see struct ieee80211_tx_queue_params */
 #define USEC_PER_TU 1024
 
-struct hwbus_ops;
+struct wfx_hwbus_ops;
 
 struct wfx_dev {
 	struct wfx_platform_data pdata;
@@ -33,7 +33,7 @@ struct wfx_dev {
 	struct ieee80211_hw	*hw;
 	struct ieee80211_vif	*vif[2];
 	struct mac_address	addresses[2];
-	const struct hwbus_ops	*hwbus_ops;
+	const struct wfx_hwbus_ops *hwbus_ops;
 	void			*hwbus_priv;
 
 	u8			keyset;
@@ -74,7 +74,7 @@ struct wfx_vif {
 	struct delayed_work	beacon_loss_work;
 
 	struct wfx_queue	tx_queue[4];
-	struct tx_policy_cache	tx_policy_cache;
+	struct wfx_tx_policy_cache tx_policy_cache;
 	struct work_struct	tx_policy_upload_work;
 
 	struct work_struct	update_tim_work;
-- 
2.34.1


  parent reply	other threads:[~2022-01-13  8:56 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-13  8:54 [PATCH 00/31] staging/wfx: apply suggestions from the linux-wireless review Jerome Pouiller
2022-01-13  8:54 ` [PATCH 01/31] staging: wfx: fix Makefile and Kconfig licenses Jerome Pouiller
2022-01-13  8:54 ` [PATCH 02/31] staging: wfx: fix HIF API license Jerome Pouiller
2022-01-13 11:50   ` Kalle Valo
2022-01-13 12:16     ` Jérôme Pouiller
2022-01-13  8:54 ` [PATCH 03/31] staging: wfx: fix missing headers Jerome Pouiller
2022-01-13  8:54 ` [PATCH 04/31] staging: wfx: fix comment correctness Jerome Pouiller
2022-01-13  8:54 ` [PATCH 05/31] staging: wfx: explain uncommon Makefile statement Jerome Pouiller
2022-01-13  8:54 ` [PATCH 06/31] staging: wfx: remove unnecessary braces Jerome Pouiller
2022-01-13  8:55 ` [PATCH 07/31] staging: wfx: remove useless #ifdef Jerome Pouiller
2022-01-13  8:55 ` [PATCH 08/31] staging: wfx: use IS_ALIGNED() Jerome Pouiller
2022-01-13  8:55 ` [PATCH 09/31] staging: wfx: replace magic value by WFX_HIF_BUFFER_SIZE Jerome Pouiller
2022-01-13  8:55 ` [PATCH 10/31] stagigg: wfx: replace magic number by HIF_ID_IS_INDICATION Jerome Pouiller
2022-01-13  8:55 ` [PATCH 11/31] staging: wfx: preserve endianness of struct hif_ind_startup Jerome Pouiller
2022-01-13  8:55 ` [PATCH 12/31] staging: wfx: fix ambiguous function name Jerome Pouiller
2022-01-13  8:55 ` [PATCH 13/31] " Jerome Pouiller
2022-01-13  8:55 ` [PATCH 14/31] staging: wfx: prefix functions from hif_*.h with wfx_ Jerome Pouiller
2022-01-13  8:55 ` [PATCH 15/31] staging: wfx: prefix functions from hwio.h " Jerome Pouiller
2022-01-13  8:55 ` [PATCH 16/31] staging: wfx: prefix functions from debug.h " Jerome Pouiller
2022-01-13  8:55 ` [PATCH 17/31] staging: wfx: prefix tx_policy_is_equal() " Jerome Pouiller
2022-01-13  8:55 ` [PATCH 18/31] staging: wfx: prefix structs hif_* " Jerome Pouiller
2022-01-13  8:55 ` Jerome Pouiller [this message]
2022-01-13  8:55 ` [PATCH 20/31] staging: wfx: reformat code on 100 columns Jerome Pouiller
2022-01-13  8:55 ` [PATCH 21/31] staging: wfx: reformat comments " Jerome Pouiller
2022-01-13  8:55 ` [PATCH 22/31] staging: wfx: fix structs alignments Jerome Pouiller
2022-01-13  8:55 ` [PATCH 23/31] staging: wfx: use explicit labels for errors Jerome Pouiller
2022-01-13  8:55 ` [PATCH 24/31] staging: wfx: replace compiletime_assert() by BUILD_BUG_ON_MSG() Jerome Pouiller
2022-01-13  8:55 ` [PATCH 25/31] staging: wfx: do not display functions names in logs Jerome Pouiller
2022-01-13  8:55 ` [PATCH 26/31] staging: wfx: remove force_ps_timeout Jerome Pouiller
2022-01-13  8:55 ` [PATCH 27/31] staging: wfx: map 'compatible' attribute with board name Jerome Pouiller
2022-01-13  8:55 ` [PATCH 28/31] staging: wfx: fix firmware location Jerome Pouiller
2022-01-13  8:55 ` [PATCH 29/31] staging: wfx: drop legacy compatible values Jerome Pouiller
2022-01-13  8:55 ` [PATCH 30/31] staging: wfx: rename "config-file" DT attribute Jerome Pouiller
2022-01-13  8:55 ` [PATCH 31/31] staging: wfx: do not probe the device if not in the DT Jerome Pouiller

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=20220113085524.1110708-20-Jerome.Pouiller@silabs.com \
    --to=jerome.pouiller@silabs.com \
    --cc=davem@davemloft.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).