Commit 8c7128c4 authored by Jules Irenge's avatar Jules Irenge Committed by Greg Kroah-Hartman
Browse files

staging: align to fix warnings of line over 80 characters



Align to fix multiple warnings of line over 80 characters.
Issue detected by checkpatch tool.

Signed-off-by: default avatarJules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/20191113110052.14855-1-jbi.octave@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7a367489
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -188,7 +188,9 @@ static int wfx_sdio_probe(struct sdio_func *func,

	bus->func = func;
	sdio_set_drvdata(func, bus);
	func->card->quirks |= MMC_QUIRK_LENIENT_FN0 | MMC_QUIRK_BLKSZ_FOR_BYTE_MODE | MMC_QUIRK_BROKEN_BYTE_MODE_512;
	func->card->quirks |= MMC_QUIRK_LENIENT_FN0 |
			      MMC_QUIRK_BLKSZ_FOR_BYTE_MODE |
			      MMC_QUIRK_BROKEN_BYTE_MODE_512;

	sdio_claim_host(func);
	ret = sdio_enable_func(func);
+2 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
struct wfx_vif;
struct sk_buff;

void wfx_rx_cb(struct wfx_vif *wvif, struct hif_ind_rx *arg, struct sk_buff *skb);
void wfx_rx_cb(struct wfx_vif *wvif, struct hif_ind_rx *arg,
	       struct sk_buff *skb);

#endif /* WFX_DATA_RX_H */
+10 −5
Original line number Diff line number Diff line
@@ -72,7 +72,8 @@ static int wfx_counters_show(struct seq_file *seq, void *v)
		return -EIO;

#define PUT_COUNTER(name) \
	seq_printf(seq, "%24s %d\n", #name ":", le32_to_cpu(counters.count_##name))
	seq_printf(seq, "%24s %d\n", #name ":",\
		   le32_to_cpu(counters.count_##name))

	PUT_COUNTER(tx_packets);
	PUT_COUNTER(tx_multicast_frames);
@@ -211,7 +212,8 @@ struct dbgfs_hif_msg {
	int ret;
};

static ssize_t wfx_send_hif_msg_write(struct file *file, const char __user *user_buf,
static ssize_t wfx_send_hif_msg_write(struct file *file,
				      const char __user *user_buf,
				      size_t count, loff_t *ppos)
{
	struct dbgfs_hif_msg *context = file->private_data;
@@ -236,7 +238,8 @@ static ssize_t wfx_send_hif_msg_write(struct file *file, const char __user *user
		kfree(request);
		return -EINVAL;
	}
	context->ret = wfx_cmd_send(wdev, request, context->reply, sizeof(context->reply), false);
	context->ret = wfx_cmd_send(wdev, request, context->reply,
				    sizeof(context->reply), false);

	kfree(request);
	complete(&context->complete);
@@ -299,8 +302,10 @@ int wfx_debug_init(struct wfx_dev *wdev)
	debugfs_create_file("counters", 0444, d, wdev, &wfx_counters_fops);
	debugfs_create_file("rx_stats", 0444, d, wdev, &wfx_rx_stats_fops);
	debugfs_create_file("send_pds", 0200, d, wdev, &wfx_send_pds_fops);
	debugfs_create_file("burn_slk_key", 0200, d, wdev, &wfx_burn_slk_key_fops);
	debugfs_create_file("send_hif_msg", 0600, d, wdev, &wfx_send_hif_msg_fops);
	debugfs_create_file("burn_slk_key", 0200, d, wdev,
			    &wfx_burn_slk_key_fops);
	debugfs_create_file("send_hif_msg", 0600, d, wdev,
			    &wfx_send_hif_msg_fops);

	return 0;
}
+45 −20
Original line number Diff line number Diff line
@@ -107,11 +107,14 @@ int get_firmware(struct wfx_dev *wdev, u32 keyset_chip,
	const char *data;
	int ret;

	snprintf(filename, sizeof(filename), "%s_%02X.sec", wdev->pdata.file_fw, keyset_chip);
	snprintf(filename, sizeof(filename), "%s_%02X.sec", wdev->pdata.file_fw,
		 keyset_chip);
	ret = firmware_request_nowarn(fw, filename, wdev->dev);
	if (ret) {
		dev_info(wdev->dev, "can't load %s, falling back to %s.sec\n", filename, wdev->pdata.file_fw);
		snprintf(filename, sizeof(filename), "%s.sec", wdev->pdata.file_fw);
		dev_info(wdev->dev, "can't load %s, falling back to %s.sec\n",
			 filename, wdev->pdata.file_fw);
		snprintf(filename, sizeof(filename), "%s.sec",
			 wdev->pdata.file_fw);
		ret = request_firmware(fw, filename, wdev->dev);
		if (ret) {
			dev_err(wdev->dev, "can't load %s\n", filename);
@@ -164,7 +167,8 @@ static int wait_ncp_status(struct wfx_dev *wdev, u32 status)
			return -ETIMEDOUT;
	}
	if (ktime_compare(now, start))
		dev_dbg(wdev->dev, "chip answer after %lldus\n", ktime_us_delta(now, start));
		dev_dbg(wdev->dev, "chip answer after %lldus\n",
			ktime_us_delta(now, start));
	else
		dev_dbg(wdev->dev, "chip answer immediately\n");
	return 0;
@@ -188,15 +192,18 @@ static int upload_firmware(struct wfx_dev *wdev, const u8 *data, size_t len)
			if (ret < 0)
				return ret;
			now = ktime_get();
			if (offs + DNLD_BLOCK_SIZE - bytes_done < DNLD_FIFO_SIZE)
			if (offs +
			    DNLD_BLOCK_SIZE - bytes_done < DNLD_FIFO_SIZE)
				break;
			if (ktime_after(now, ktime_add_ms(start, DCA_TIMEOUT)))
				return -ETIMEDOUT;
		}
		if (ktime_compare(now, start))
			dev_dbg(wdev->dev, "answer after %lldus\n", ktime_us_delta(now, start));
			dev_dbg(wdev->dev, "answer after %lldus\n",
				ktime_us_delta(now, start));

		ret = sram_write_dma_safe(wdev, WFX_DNLD_FIFO + (offs % DNLD_FIFO_SIZE),
		ret = sram_write_dma_safe(wdev, WFX_DNLD_FIFO +
					  (offs % DNLD_FIFO_SIZE),
					  data + offs, DNLD_BLOCK_SIZE);
		if (ret < 0)
			return ret;
@@ -220,10 +227,14 @@ static void print_boot_status(struct wfx_dev *wdev)
		dev_info(wdev->dev, "no error reported by secure boot\n");
	} else {
		sram_reg_read(wdev, WFX_ERR_INFO, &val32);
		if (val32 < ARRAY_SIZE(fwio_error_strings) && fwio_error_strings[val32])
			dev_info(wdev->dev, "secure boot error: %s\n", fwio_error_strings[val32]);
		if (val32 < ARRAY_SIZE(fwio_error_strings) &&
		    fwio_error_strings[val32])
			dev_info(wdev->dev, "secure boot error: %s\n",
				 fwio_error_strings[val32]);
		else
			dev_info(wdev->dev, "secure boot error: Unknown (0x%02x)\n", val32);
			dev_info(wdev->dev,
				 "secure boot error: Unknown (0x%02x)\n",
				 val32);
	}
}

@@ -262,9 +273,13 @@ static int load_firmware_secure(struct wfx_dev *wdev)
		goto error;

	sram_reg_write(wdev, WFX_DNLD_FIFO, 0xFFFFFFFF); // Fifo init
	sram_write_dma_safe(wdev, WFX_DCA_FW_VERSION, "\x01\x00\x00\x00", FW_VERSION_SIZE);
	sram_write_dma_safe(wdev, WFX_DCA_FW_SIGNATURE, fw->data + fw_offset, FW_SIGNATURE_SIZE);
	sram_write_dma_safe(wdev, WFX_DCA_FW_HASH, fw->data + fw_offset + FW_SIGNATURE_SIZE, FW_HASH_SIZE);
	sram_write_dma_safe(wdev, WFX_DCA_FW_VERSION, "\x01\x00\x00\x00",
			    FW_VERSION_SIZE);
	sram_write_dma_safe(wdev, WFX_DCA_FW_SIGNATURE, fw->data + fw_offset,
			    FW_SIGNATURE_SIZE);
	sram_write_dma_safe(wdev, WFX_DCA_FW_HASH,
			    fw->data + fw_offset + FW_SIGNATURE_SIZE,
			    FW_HASH_SIZE);
	sram_reg_write(wdev, WFX_DCA_IMAGE_SIZE, fw->size - header_size);
	sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_UPLOAD_PENDING);
	ret = wait_ncp_status(wdev, NCP_DOWNLOAD_PENDING);
@@ -272,10 +287,12 @@ static int load_firmware_secure(struct wfx_dev *wdev)
		goto error;

	start = ktime_get();
	ret = upload_firmware(wdev, fw->data + header_size, fw->size - header_size);
	ret = upload_firmware(wdev, fw->data + header_size,
			      fw->size - header_size);
	if (ret)
		goto error;
	dev_dbg(wdev->dev, "firmware load after %lldus\n", ktime_us_delta(ktime_get(), start));
	dev_dbg(wdev->dev, "firmware load after %lldus\n",
		ktime_us_delta(ktime_get(), start));

	sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_UPLOAD_COMPLETE);
	ret = wait_ncp_status(wdev, NCP_AUTH_OK);
@@ -310,10 +327,12 @@ static int init_gpr(struct wfx_dev *wdev)
	};

	for (i = 0; i < ARRAY_SIZE(gpr_init); i++) {
		ret = igpr_reg_write(wdev, gpr_init[i].index, gpr_init[i].value);
		ret = igpr_reg_write(wdev, gpr_init[i].index,
				     gpr_init[i].value);
		if (ret < 0)
			return ret;
		dev_dbg(wdev->dev, "  index %02x: %08x\n", gpr_init[i].index, gpr_init[i].value);
		dev_dbg(wdev->dev, "  index %02x: %08x\n", gpr_init[i].index,
			gpr_init[i].value);
	}
	return 0;
}
@@ -348,7 +367,8 @@ int wfx_init_device(struct wfx_dev *wdev)

	hw_revision = FIELD_GET(CFG_DEVICE_ID_MAJOR, reg);
	if (hw_revision == 0 || hw_revision > 2) {
		dev_err(wdev->dev, "bad hardware revision number: %d\n", hw_revision);
		dev_err(wdev->dev, "bad hardware revision number: %d\n",
			hw_revision);
		return -ENODEV;
	}
	hw_type = FIELD_GET(CFG_DEVICE_ID_TYPE, reg);
@@ -375,7 +395,8 @@ int wfx_init_device(struct wfx_dev *wdev)
			return -ETIMEDOUT;
		}
	}
	dev_dbg(wdev->dev, "chip wake up after %lldus\n", ktime_us_delta(now, start));
	dev_dbg(wdev->dev, "chip wake up after %lldus\n",
		ktime_us_delta(now, start));

	ret = config_reg_write_bits(wdev, CFG_CPU_RESET, 0);
	if (ret < 0)
@@ -383,6 +404,10 @@ int wfx_init_device(struct wfx_dev *wdev)
	ret = load_firmware_secure(wdev);
	if (ret < 0)
		return ret;
	ret = config_reg_write_bits(wdev, CFG_DIRECT_ACCESS_MODE | CFG_IRQ_ENABLE_DATA | CFG_IRQ_ENABLE_WRDY, CFG_IRQ_ENABLE_DATA);
	ret = config_reg_write_bits(wdev,
				    CFG_DIRECT_ACCESS_MODE |
				    CFG_IRQ_ENABLE_DATA |
				    CFG_IRQ_ENABLE_WRDY,
				    CFG_IRQ_ENABLE_DATA);
	return ret;
}
+53 −25
Original line number Diff line number Diff line
@@ -18,7 +18,8 @@
#include "secure_link.h"
#include "hif_api_cmd.h"

static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif,
			       void *buf)
{
	// All confirm messages start with status
	int status = le32_to_cpu(*((__le32 *) buf));
@@ -33,7 +34,8 @@ static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *
	}

	if (cmd != wdev->hif_cmd.buf_send->id) {
		dev_warn(wdev->dev, "chip response mismatch request: 0x%.2x vs 0x%.2x\n",
		dev_warn(wdev->dev,
			 "chip response mismatch request: 0x%.2x vs 0x%.2x\n",
			 cmd, wdev->hif_cmd.buf_send->id);
		return -EINVAL;
	}
@@ -70,7 +72,8 @@ static int hif_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
	return 0;
}

static int hif_multi_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
static int hif_multi_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif,
				void *buf)
{
	struct hif_cnf_multi_transmit *body = buf;
	struct hif_cnf_tx *buf_loc = (struct hif_cnf_tx *) &body->tx_conf_payload;
@@ -90,7 +93,8 @@ static int hif_multi_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void
	return 0;
}

static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif,
				  void *buf)
{
	struct hif_ind_startup *body = buf;

@@ -108,7 +112,8 @@ static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif, voi
	return 0;
}

static int hif_wakeup_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
static int hif_wakeup_indication(struct wfx_dev *wdev, struct hif_msg *hif,
				 void *buf)
{
	if (!wdev->pdata.gpio_wakeup
	    || !gpiod_get_value(wdev->pdata.gpio_wakeup)) {
@@ -118,7 +123,8 @@ static int hif_wakeup_indication(struct wfx_dev *wdev, struct hif_msg *hif, void
	return 0;
}

static int hif_keys_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
static int hif_keys_indication(struct wfx_dev *wdev, struct hif_msg *hif,
			       void *buf)
{
	struct hif_ind_sl_exchange_pub_keys *body = buf;

@@ -131,13 +137,15 @@ static int hif_keys_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *
	return 0;
}

static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf, struct sk_buff *skb)
static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif,
				  void *buf, struct sk_buff *skb)
{
	struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
	struct hif_ind_rx *body = buf;

	if (!wvif) {
		dev_warn(wdev->dev, "ignore rx data for non-existent vif %d\n", hif->interface);
		dev_warn(wdev->dev, "ignore rx data for non-existent vif %d\n",
			 hif->interface);
		return 0;
	}
	skb_pull(skb, sizeof(struct hif_msg) + sizeof(struct hif_ind_rx));
@@ -146,7 +154,8 @@ static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif, voi
	return 0;
}

static int hif_event_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
static int hif_event_indication(struct wfx_dev *wdev, struct hif_msg *hif,
				void *buf)
{
	struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
	struct hif_ind_event *body = buf;
@@ -173,7 +182,8 @@ static int hif_event_indication(struct wfx_dev *wdev, struct hif_msg *hif, void
	return 0;
}

static int hif_pm_mode_complete_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
static int hif_pm_mode_complete_indication(struct wfx_dev *wdev,
					   struct hif_msg *hif, void *buf)
{
	struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);

@@ -183,7 +193,8 @@ static int hif_pm_mode_complete_indication(struct wfx_dev *wdev, struct hif_msg
	return 0;
}

static int hif_scan_complete_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
static int hif_scan_complete_indication(struct wfx_dev *wdev,
					struct hif_msg *hif, void *buf)
{
	struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
	struct hif_ind_scan_cmpl *body = buf;
@@ -194,7 +205,8 @@ static int hif_scan_complete_indication(struct wfx_dev *wdev, struct hif_msg *hi
	return 0;
}

static int hif_join_complete_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
static int hif_join_complete_indication(struct wfx_dev *wdev,
					struct hif_msg *hif, void *buf)
{
	struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);

@@ -204,7 +216,8 @@ static int hif_join_complete_indication(struct wfx_dev *wdev, struct hif_msg *hi
	return 0;
}

static int hif_suspend_resume_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
static int hif_suspend_resume_indication(struct wfx_dev *wdev,
					 struct hif_msg *hif, void *buf)
{
	struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
	struct hif_ind_suspend_resume_tx *body = buf;
@@ -215,7 +228,8 @@ static int hif_suspend_resume_indication(struct wfx_dev *wdev, struct hif_msg *h
	return 0;
}

static int hif_error_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
static int hif_error_indication(struct wfx_dev *wdev, struct hif_msg *hif,
				void *buf)
{
	struct hif_ind_error *body = buf;
	u8 *pRollback = (u8 *) body->data;
@@ -223,31 +237,39 @@ static int hif_error_indication(struct wfx_dev *wdev, struct hif_msg *hif, void

	switch (body->type) {
	case HIF_ERROR_FIRMWARE_ROLLBACK:
		dev_err(wdev->dev, "asynchronous error: firmware rollback error %d\n", *pRollback);
		dev_err(wdev->dev,
			"asynchronous error: firmware rollback error %d\n",
			*pRollback);
		break;
	case HIF_ERROR_FIRMWARE_DEBUG_ENABLED:
		dev_err(wdev->dev, "asynchronous error: firmware debug feature enabled\n");
		break;
	case HIF_ERROR_OUTDATED_SESSION_KEY:
		dev_err(wdev->dev, "asynchronous error: secure link outdated key: %#.8x\n", *pStatus);
		dev_err(wdev->dev, "asynchronous error: secure link outdated key: %#.8x\n",
			*pStatus);
		break;
	case HIF_ERROR_INVALID_SESSION_KEY:
		dev_err(wdev->dev, "asynchronous error: invalid session key\n");
		break;
	case HIF_ERROR_OOR_VOLTAGE:
		dev_err(wdev->dev, "asynchronous error: out-of-range overvoltage: %#.8x\n", *pStatus);
		dev_err(wdev->dev, "asynchronous error: out-of-range overvoltage: %#.8x\n",
			*pStatus);
		break;
	case HIF_ERROR_PDS_VERSION:
		dev_err(wdev->dev, "asynchronous error: wrong PDS payload or version: %#.8x\n", *pStatus);
		dev_err(wdev->dev,
			"asynchronous error: wrong PDS payload or version: %#.8x\n",
			*pStatus);
		break;
	default:
		dev_err(wdev->dev, "asynchronous error: unknown (%d)\n", body->type);
		dev_err(wdev->dev, "asynchronous error: unknown (%d)\n",
			body->type);
		break;
	}
	return 0;
}

static int hif_generic_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
static int hif_generic_indication(struct wfx_dev *wdev, struct hif_msg *hif,
				  void *buf)
{
	struct hif_ind_generic *body = buf;

@@ -255,23 +277,29 @@ static int hif_generic_indication(struct wfx_dev *wdev, struct hif_msg *hif, voi
	case HIF_GENERIC_INDICATION_TYPE_RAW:
		return 0;
	case HIF_GENERIC_INDICATION_TYPE_STRING:
		dev_info(wdev->dev, "firmware says: %s\n", (char *) body->indication_data.raw_data);
		dev_info(wdev->dev, "firmware says: %s\n",
			 (char *) body->indication_data.raw_data);
		return 0;
	case HIF_GENERIC_INDICATION_TYPE_RX_STATS:
		mutex_lock(&wdev->rx_stats_lock);
		// Older firmware send a generic indication beside RxStats
		if (!wfx_api_older_than(wdev, 1, 4))
			dev_info(wdev->dev, "Rx test ongoing. Temperature: %d°C\n", body->indication_data.rx_stats.current_temp);
		memcpy(&wdev->rx_stats, &body->indication_data.rx_stats, sizeof(wdev->rx_stats));
			dev_info(wdev->dev, "Rx test ongoing. Temperature: %d°C\n",
				 body->indication_data.rx_stats.current_temp);
		memcpy(&wdev->rx_stats, &body->indication_data.rx_stats,
		       sizeof(wdev->rx_stats));
		mutex_unlock(&wdev->rx_stats_lock);
		return 0;
	default:
		dev_err(wdev->dev, "generic_indication: unknown indication type: %#.8x\n", body->indication_type);
		dev_err(wdev->dev,
			"generic_indication: unknown indication type: %#.8x\n",
			body->indication_type);
		return -EIO;
	}
}

static int hif_exception_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf)
static int hif_exception_indication(struct wfx_dev *wdev,
				    struct hif_msg *hif, void *buf)
{
	size_t len = hif->len - 4; // drop header
	dev_err(wdev->dev, "firmware exception\n");
Loading