Commit bf99f11d authored by Wolfram Sang's avatar Wolfram Sang Committed by Kalle Valo
Browse files

wifi: move from strlcpy with unused retval to strscpy

Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/


Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220830201457.7984-2-wsa+renesas@sang-engineering.com
parent 1dc13236
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1014,7 +1014,7 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)

		switch (ie_id) {
		case ATH6KL_FW_IE_FW_VERSION:
			strlcpy(ar->wiphy->fw_version, data,
			strscpy(ar->wiphy->fw_version, data,
				min(sizeof(ar->wiphy->fw_version), ie_len+1));

			ath6kl_dbg(ATH6KL_DBG_BOOT,
+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ static void carl9170_fw_info(struct ar9170 *ar)
			 CARL9170FW_GET_MONTH(fw_date),
			 CARL9170FW_GET_DAY(fw_date));

		strlcpy(ar->hw->wiphy->fw_version, motd_desc->release,
		strscpy(ar->hw->wiphy->fw_version, motd_desc->release,
			sizeof(ar->hw->wiphy->fw_version));
	}
}
+1 −1
Original line number Diff line number Diff line
@@ -1305,7 +1305,7 @@ void wil_get_board_file(struct wil6210_priv *wil, char *buf, size_t len)
			board_file = WIL_BOARD_FILE_NAME;
	}

	strlcpy(buf, board_file, len);
	strscpy(buf, board_file, len);
}

static int wil_get_bl_info(struct wil6210_priv *wil)
+1 −1
Original line number Diff line number Diff line
@@ -445,7 +445,7 @@ int wil_if_add(struct wil6210_priv *wil)

	wil_dbg_misc(wil, "entered");

	strlcpy(wiphy->fw_version, wil->fw_version, sizeof(wiphy->fw_version));
	strscpy(wiphy->fw_version, wil->fw_version, sizeof(wiphy->fw_version));

	rc = wiphy_register(wiphy);
	if (rc < 0) {
+1 −1
Original line number Diff line number Diff line
@@ -780,7 +780,7 @@ static void wmi_evt_ready(struct wil6210_vif *vif, int id, void *d, int len)
		return; /* FW load will fail after timeout */
	}
	/* ignore MAC address, we already have it from the boot loader */
	strlcpy(wiphy->fw_version, wil->fw_version, sizeof(wiphy->fw_version));
	strscpy(wiphy->fw_version, wil->fw_version, sizeof(wiphy->fw_version));

	if (len > offsetof(struct wmi_ready_event, rfc_read_calib_result)) {
		wil_dbg_wmi(wil, "rfc calibration result %d\n",
Loading