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

staging: wfx: reformat comments 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 in every comments.

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


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 381d3295
Loading
Loading
Loading
Loading
+11 −15
Original line number Diff line number Diff line
@@ -32,18 +32,15 @@ static void device_wakeup(struct wfx_dev *wdev)
	}
	for (;;) {
		gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 1);
		/* completion.h does not provide any function to wait
		 * completion without consume it (a kind of
		 * wait_for_completion_done_timeout()). So we have to emulate
		 * it.
		/* completion.h does not provide any function to wait completion without consume it
		 * (a kind of wait_for_completion_done_timeout()). So we have to emulate it.
		 */
		if (wait_for_completion_timeout(&wdev->hif.ctrl_ready, msecs_to_jiffies(2))) {
			complete(&wdev->hif.ctrl_ready);
			return;
		} else if (max_retry-- > 0) {
			/* Older firmwares have a race in sleep/wake-up process.
			 * Redo the process is sufficient to unfreeze the
			 * chip.
			/* Older firmwares have a race in sleep/wake-up process.  Redo the process
			 * is sufficient to unfreeze the chip.
			 */
			dev_err(wdev->dev, "timeout while wake up chip\n");
			gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 0);
@@ -219,9 +216,9 @@ static int bh_work_tx(struct wfx_dev *wdev, int max_msg)
	return i;
}

/* In SDIO mode, it is necessary to make an access to a register to acknowledge
 * last received message. It could be possible to restrict this acknowledge to
 * SDIO mode and only if last operation was rx.
/* In SDIO mode, it is necessary to make an access to a register to acknowledge last received
 * message. It could be possible to restrict this acknowledge to SDIO mode and only if last
 * operation was rx.
 */
static void ack_sdio_data(struct wfx_dev *wdev)
{
@@ -287,12 +284,11 @@ void wfx_bh_request_tx(struct wfx_dev *wdev)
	queue_work(system_highpri_wq, &wdev->hif.bh);
}

/* If IRQ is not available, this function allow to manually poll the control
 * register and simulate an IRQ ahen an event happened.
/* If IRQ is not available, this function allow to manually poll the control register and simulate
 * an IRQ ahen an event happened.
 *
 * Note that the device has a bug: If an IRQ raise while host read control
 * register, the IRQ is lost. So, use this function carefully (only duing
 * device initialisation).
 * Note that the device has a bug: If an IRQ raise while host read control register, the IRQ is
 * lost. So, use this function carefully (only duing device initialisation).
 */
void wfx_bh_poll_irq(struct wfx_dev *wdev)
{
+6 −8
Original line number Diff line number Diff line
@@ -38,13 +38,12 @@ struct wfx_spi_priv {
	bool need_swab;
};

/* The chip reads 16bits of data at time and place them directly into (little
 * endian) CPU register. So, the chip expects bytes order to be "B1 B0 B3 B2"
 * (while LE is "B0 B1 B2 B3" and BE is "B3 B2 B1 B0")
/* The chip reads 16bits of data at time and place them directly into (little endian) CPU register.
 * So, the chip expects bytes order to be "B1 B0 B3 B2" (while LE is "B0 B1 B2 B3" and BE is
 * "B3 B2 B1 B0")
 *
 * A little endian host with bits_per_word == 16 should do the right job
 * natively. The code below to support big endian host and commonly used SPI
 * 8bits.
 * A little endian host with bits_per_word == 16 should do the right job 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)
{
@@ -160,8 +159,7 @@ static int wfx_spi_irq_unsubscribe(void *priv)

static size_t wfx_spi_align_size(void *priv, size_t size)
{
	/* Most of SPI controllers avoid DMA if buffer size is not 32bit aligned
	 */
	/* Most of SPI controllers avoid DMA if buffer size is not 32bit aligned */
	return ALIGN(size, 4);
}

+2 −2
Original line number Diff line number Diff line
@@ -74,8 +74,8 @@ void wfx_rx_cb(struct wfx_vif *wvif, const struct wfx_hif_ind_rx *arg, struct sk
	if (arg->encryp)
		hdr->flag |= RX_FLAG_DECRYPTED;

	/* Block ack negotiation is offloaded by the firmware. However,
	 * re-ordering must be done by the mac80211.
	/* Block ack negotiation is offloaded by the firmware. However, re-ordering must be done by
	 * the mac80211.
	 */
	if (ieee80211_is_action(frame->frame_control) &&
	    mgmt->u.action.category == WLAN_CATEGORY_BACK &&
+6 −7
Original line number Diff line number Diff line
@@ -30,8 +30,8 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev, const struct ieee80211_tx_rate
		}
		return rate->idx + 14;
	}
	/* The device only support 2GHz, else band information should be
	 * retrieved from ieee80211_tx_info
	/* The device only support 2GHz, else band information should be retrieved from
	 * ieee80211_tx_info
	 */
	band = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ];
	if (rate->idx >= band->n_bitrates) {
@@ -356,9 +356,8 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct

	/* Fill tx request */
	req = (struct wfx_hif_req_tx *)hif_msg->body;
	/* packet_id just need to be unique on device. 32bits are more than
	 * necessary for that task, so we tae advantage of it to add some extra
	 * data for debug.
	/* packet_id just need to be unique on device. 32bits are more than necessary for that task,
	 * so we take advantage of it to add some extra data for debug.
	 */
	req->packet_id = atomic_add_return(1, &wvif->wdev->packet_id) & 0xFFFF;
	req->packet_id |= IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)) << 16;
@@ -402,8 +401,8 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struc
		wvif = wvif_iterate(wdev, NULL);
	if (WARN_ON(!wvif))
		goto drop;
	/* Because of TX_AMPDU_SETUP_IN_HW, mac80211 does not try to send any
	 * BlockAck session management frame. The check below exist just in case.
	/* Because of TX_AMPDU_SETUP_IN_HW, mac80211 does not try to send any BlockAck session
	 * management frame. The check below exist just in case.
	 */
	if (wfx_is_action_back(hdr)) {
		dev_info(wdev->dev, "drop BA action\n");
+4 −6
Original line number Diff line number Diff line
@@ -250,9 +250,9 @@ static ssize_t wfx_send_hif_msg_write(struct file *file, const char __user *user
	if (count < sizeof(struct wfx_hif_msg))
		return -EINVAL;

	/* wfx_cmd_send() checks that reply buffer is wide enough, but does not
	 * return precise length read. User have to know how many bytes should
	 * be read. Filling reply buffer with a memory pattern may help user.
	/* wfx_cmd_send() checks that reply buffer is wide enough, but does not return precise
	 * length read. User have to know how many bytes should be read. Filling reply buffer with a
	 * memory pattern may help user.
	 */
	memset(context->reply, 0xFF, sizeof(context->reply));
	request = memdup_user(user_buf, count);
@@ -282,9 +282,7 @@ static ssize_t wfx_send_hif_msg_read(struct file *file, char __user *user_buf,
		return ret;
	if (context->ret < 0)
		return context->ret;
	/* Be careful, write() is waiting for a full message while read()
	 * only returns a payload
	 */
	/* Be careful, write() is waiting for a full message while read() only returns a payload */
	if (copy_to_user(user_buf, context->reply, count))
		return -EFAULT;

Loading