linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Wen Gong <quic_wgong@quicinc.com>
Cc: <ath11k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH v6 2/2] ath11k: add read variant from SMBIOS for download board data
Date: Mon, 21 Mar 2022 12:33:44 +0200	[thread overview]
Message-ID: <874k3roarb.fsf@kernel.org> (raw)
In-Reply-To: <20220315104721.26649-3-quic_wgong@quicinc.com> (Wen Gong's message of "Tue, 15 Mar 2022 06:47:21 -0400")

Wen Gong <quic_wgong@quicinc.com> writes:

> This is to read variant from SMBIOS such as read from DT, the variant
> string will be used to one part of string which used to search board
> data from board-2.bin.
>
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
>
> Signed-off-by: Wen Gong <quic_wgong@quicinc.com>

[...]

> +	/* Copy extension name without magic prefix */
> +	if (strscpy(ab->qmi.target.bdf_ext, smbios->bdf_ext + strlen(magic),
> +		    sizeof(ab->qmi.target.bdf_ext)) < 0) {
> +		ath11k_dbg(ab, ATH11K_DBG_BOOT,
> +			   "bdf variant string is longer than the buffer can accommodate\n");
> +		return;
> +	}

In the pending branch I changed this a bit to follow the style used in
ath11k:

@@ -548,8 +548,9 @@ static void ath11k_core_check_bdfext(const struct dmi_header *hdr, void *data)
        struct ath11k_base *ab = data;
        const char *magic = ATH11K_SMBIOS_BDF_EXT_MAGIC;
        struct ath11k_smbios_bdf *smbios = (struct ath11k_smbios_bdf *)hdr;
-       int i;
+       ssize_t copied;
        size_t len;
+       int i;
 
        if (ab->qmi.target.bdf_ext[0] != '\0')
                return;
@@ -587,8 +588,9 @@ static void ath11k_core_check_bdfext(const struct dmi_header *hdr, void *data)
        }
 
        /* Copy extension name without magic prefix */
-       if (strscpy(ab->qmi.target.bdf_ext, smbios->bdf_ext + strlen(magic),
-                   sizeof(ab->qmi.target.bdf_ext)) < 0) {
+       copied = strscpy(ab->qmi.target.bdf_ext, smbios->bdf_ext + strlen(magic),
+                        sizeof(ab->qmi.target.bdf_ext));
+       if (copied < 0) {
                ath11k_dbg(ab, ATH11K_DBG_BOOT,
                           "bdf variant string is longer than the buffer can accommodate\n");
                return;

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2022-03-21 10:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 10:47 [PATCH v6 0/2] ath11k: add handler for board-2.bin without variant and read SMBIOS Wen Gong
2022-03-15 10:47 ` [PATCH v6 1/2] ath11k: add fallback board name without variant while searching board-2.bin Wen Gong
2022-03-25 10:30   ` Kalle Valo
2022-03-15 10:47 ` [PATCH v6 2/2] ath11k: add read variant from SMBIOS for download board data Wen Gong
2022-03-21 10:33   ` Kalle Valo [this message]
2022-03-23  8:47   ` Kalle Valo
2022-03-23  8:52     ` Wen Gong
2022-03-23 13:05       ` Kalle Valo
2022-03-21 10:31 ` [PATCH v6 0/2] ath11k: add handler for board-2.bin without variant and read SMBIOS Kalle Valo

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=874k3roarb.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=ath11k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_wgong@quicinc.com \
    /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 NNTP newsgroup(s).