Thread (98 messages) 98 messages, 7 authors, 2022-01-03

Re: [PATCH 03/34] brcmfmac: firmware: Support having multiple alt paths

From: Dmitry Osipenko <digetx@gmail.com>
Date: 2022-01-02 06:45:37
Also in: linux-acpi, linux-devicetree, linux-wireless, lkml

26.12.2021 18:35, Hector Martin пишет:
quoted hunk ↗ jump to hunk
-static char *brcm_alt_fw_path(const char *path, const char *board_type)
+static const char **brcm_alt_fw_paths(const char *path, const char *board_type)
 {
 	char alt_path[BRCMF_FW_NAME_LEN];
+	char **alt_paths;
 	char suffix[5];
 
 	strscpy(alt_path, path, BRCMF_FW_NAME_LEN);
@@ -609,27 +612,46 @@ static char *brcm_alt_fw_path(const char *path, const char *board_type)
 	strlcat(alt_path, board_type, BRCMF_FW_NAME_LEN);
 	strlcat(alt_path, suffix, BRCMF_FW_NAME_LEN);
 
-	return kstrdup(alt_path, GFP_KERNEL);
+	alt_paths = kzalloc(sizeof(char *) * 2, GFP_KERNEL);
array_size()?
+	alt_paths[0] = kstrdup(alt_path, GFP_KERNEL);
+
+	return (const char **)alt_paths;
Why this casting is needed?
+}
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help