Commit 381d3295 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman
Browse files

staging: wfx: reformat code on 100 columns



Until now, this driver was written in 80 columns style. However, since
all the functions are prefixed with "wfx_", this constraint is no more
respected in the last patches.

From the perspective of kernel Coding Style, it is not a problem since
it is now allowed to write code on 100 columns.

This patch just unify the code to use 100 columns.

Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-21-Jerome.Pouiller@silabs.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 07874db4
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -37,8 +37,7 @@ static void device_wakeup(struct wfx_dev *wdev)
		 * wait_for_completion_done_timeout()). So we have to emulate
		 * it.
		 */
		if (wait_for_completion_timeout(&wdev->hif.ctrl_ready,
						msecs_to_jiffies(2))) {
		if (wait_for_completion_timeout(&wdev->hif.ctrl_ready, msecs_to_jiffies(2))) {
			complete(&wdev->hif.ctrl_ready);
			return;
		} else if (max_retry-- > 0) {
@@ -105,7 +104,8 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf)
	if (!(hif->id & HIF_ID_IS_INDICATION)) {
		(*is_cnf)++;
		if (hif->id == HIF_CNF_ID_MULTI_TRANSMIT)
			release_count = ((struct wfx_hif_cnf_multi_transmit *)hif->body)->num_tx_confs;
			release_count =
				((struct wfx_hif_cnf_multi_transmit *)hif->body)->num_tx_confs;
		else
			release_count = 1;
		WARN(wdev->hif.tx_buffers_used < release_count, "corrupted buffer counter");
@@ -229,8 +229,7 @@ static void ack_sdio_data(struct wfx_dev *wdev)

	wfx_config_reg_read(wdev, &cfg_reg);
	if (cfg_reg & 0xFF) {
		dev_warn(wdev->dev, "chip reports errors: %02x\n",
			 cfg_reg & 0xFF);
		dev_warn(wdev->dev, "chip reports errors: %02x\n", cfg_reg & 0xFF);
		wfx_config_reg_write_bits(wdev, 0xFF, 0x00);
	}
}
@@ -261,8 +260,7 @@ static void bh_work(struct work_struct *work)
		device_release(wdev);
		release_chip = true;
	}
	_trace_bh_stats(stats_ind, stats_req, stats_cnf,
			wdev->hif.tx_buffers_used, release_chip);
	_trace_bh_stats(stats_ind, stats_req, stats_cnf, wdev->hif.tx_buffers_used, release_chip);
}

/* An IRQ from chip did occur */
+2 −4
Original line number Diff line number Diff line
@@ -21,10 +21,8 @@
#define WFX_REG_FRAME_OUT     0x7

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,
			  const void *src, size_t count);
	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, const void *src, size_t count);
	int (*irq_subscribe)(void *bus_priv);
	int (*irq_unsubscribe)(void *bus_priv);
	void (*lock)(void *bus_priv);
+4 −8
Original line number Diff line number Diff line
@@ -33,8 +33,7 @@ struct wfx_sdio_priv {
	int of_irq;
};

static int wfx_sdio_copy_from_io(void *priv, unsigned int reg_id,
				 void *dst, size_t count)
static int wfx_sdio_copy_from_io(void *priv, unsigned int reg_id, void *dst, size_t count)
{
	struct wfx_sdio_priv *bus = priv;
	unsigned int sdio_addr = reg_id << 2;
@@ -54,8 +53,7 @@ static int wfx_sdio_copy_from_io(void *priv, unsigned int reg_id,
	return ret;
}

static int wfx_sdio_copy_to_io(void *priv, unsigned int reg_id,
			       const void *src, size_t count)
static int wfx_sdio_copy_to_io(void *priv, unsigned int reg_id, const void *src, size_t count)
{
	struct wfx_sdio_priv *bus = priv;
	unsigned int sdio_addr = reg_id << 2;
@@ -126,8 +124,7 @@ static int wfx_sdio_irq_subscribe(void *priv)
		flags = IRQF_TRIGGER_HIGH;
	flags |= IRQF_ONESHOT;
	ret = devm_request_threaded_irq(&bus->func->dev, bus->of_irq, NULL,
					wfx_sdio_irq_handler_ext, flags,
					"wfx", bus);
					wfx_sdio_irq_handler_ext, flags, "wfx", bus);
	if (ret)
		return ret;
	sdio_claim_host(bus->func);
@@ -176,8 +173,7 @@ static const struct of_device_id wfx_sdio_of_match[] = {
};
MODULE_DEVICE_TABLE(of, wfx_sdio_of_match);

static int wfx_sdio_probe(struct sdio_func *func,
			  const struct sdio_device_id *id)
static int wfx_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
{
	struct device_node *np = func->dev.of_node;
	struct wfx_sdio_priv *bus;
+8 −16
Original line number Diff line number Diff line
@@ -46,8 +46,7 @@ struct wfx_spi_priv {
 * natively. The code below to support big endian host and commonly used SPI
 * 8bits.
 */
static int wfx_spi_copy_from_io(void *priv, unsigned int addr,
				void *dst, size_t count)
static int wfx_spi_copy_from_io(void *priv, unsigned int addr, void *dst, size_t count)
{
	struct wfx_spi_priv *bus = priv;
	u16 regaddr = (addr << 12) | (count / 2) | SET_READ;
@@ -80,8 +79,7 @@ static int wfx_spi_copy_from_io(void *priv, unsigned int addr,
	return ret;
}

static int wfx_spi_copy_to_io(void *priv, unsigned int addr,
			      const void *src, size_t count)
static int wfx_spi_copy_to_io(void *priv, unsigned int addr, const void *src, size_t count)
{
	struct wfx_spi_priv *bus = priv;
	u16 regaddr = (addr << 12) | (count / 2);
@@ -149,8 +147,7 @@ static int wfx_spi_irq_subscribe(void *priv)
		flags = IRQF_TRIGGER_HIGH;
	flags |= IRQF_ONESHOT;
	return devm_request_threaded_irq(&bus->func->dev, bus->func->irq, NULL,
					 wfx_spi_irq_handler, IRQF_ONESHOT,
					 "wfx", bus);
					 wfx_spi_irq_handler, IRQF_ONESHOT, "wfx", bus);
}

static int wfx_spi_irq_unsubscribe(void *priv)
@@ -190,14 +187,11 @@ static int wfx_spi_probe(struct spi_device *func)
		return ret;
	/* Trace below is also displayed by spi_setup() if compiled with DEBUG */
	dev_dbg(&func->dev, "SPI params: CS=%d, mode=%d bits/word=%d speed=%d\n",
		func->chip_select, func->mode, func->bits_per_word,
		func->max_speed_hz);
		func->chip_select, func->mode, func->bits_per_word, func->max_speed_hz);
	if (func->bits_per_word != 16 && func->bits_per_word != 8)
		dev_warn(&func->dev, "unusual bits/word value: %d\n",
			 func->bits_per_word);
		dev_warn(&func->dev, "unusual bits/word value: %d\n", func->bits_per_word);
	if (func->max_speed_hz > 50000000)
		dev_warn(&func->dev, "%dHz is a very high speed\n",
			 func->max_speed_hz);
		dev_warn(&func->dev, "%dHz is a very high speed\n", func->max_speed_hz);

	bus = devm_kzalloc(&func->dev, sizeof(*bus), GFP_KERNEL);
	if (!bus)
@@ -207,13 +201,11 @@ static int wfx_spi_probe(struct spi_device *func)
		bus->need_swab = true;
	spi_set_drvdata(func, bus);

	bus->gpio_reset = devm_gpiod_get_optional(&func->dev, "reset",
						  GPIOD_OUT_LOW);
	bus->gpio_reset = devm_gpiod_get_optional(&func->dev, "reset", GPIOD_OUT_LOW);
	if (IS_ERR(bus->gpio_reset))
		return PTR_ERR(bus->gpio_reset);
	if (!bus->gpio_reset) {
		dev_warn(&func->dev,
			 "gpio reset is not defined, trying to load firmware anyway\n");
		dev_warn(&func->dev, "gpio reset is not defined, trying to load firmware anyway\n");
	} else {
		gpiod_set_consumer_name(bus->gpio_reset, "wfx reset");
		if (spi_get_device_id(func)->driver_data & WFX_RESET_INVERTED)
+2 −4
Original line number Diff line number Diff line
@@ -34,8 +34,7 @@ static void wfx_rx_handle_ba(struct wfx_vif *wvif, struct ieee80211_mgmt *mgmt)
	}
}

void wfx_rx_cb(struct wfx_vif *wvif,
	       const struct wfx_hif_ind_rx *arg, struct sk_buff *skb)
void wfx_rx_cb(struct wfx_vif *wvif, const struct wfx_hif_ind_rx *arg, struct sk_buff *skb)
{
	struct ieee80211_rx_status *hdr = IEEE80211_SKB_RXCB(skb);
	struct ieee80211_hdr *frame = (struct ieee80211_hdr *)skb->data;
@@ -54,8 +53,7 @@ void wfx_rx_cb(struct wfx_vif *wvif,
	}

	hdr->band = NL80211_BAND_2GHZ;
	hdr->freq = ieee80211_channel_to_frequency(arg->channel_number,
						   hdr->band);
	hdr->freq = ieee80211_channel_to_frequency(arg->channel_number, hdr->band);

	if (arg->rxed_rate >= 14) {
		hdr->encoding = RX_ENC_HT;
Loading