Skip to content

Commit f804a58

Browse files
superm1nbd168
authored andcommitted
wifi: mt76: Strip whitespace from build ddate
On systems I have with mt7925 cards I've been noticing a blank line in my kernel logs. IE: ``` [ 17.294105] mt7925e 0000:c3:00.0: HW/SW Version: 0x8a108a10, Build Time: 20250721232852a [ 17.314233] r8169 0000:c4:00.0 enp196s0f0: Link is Down ``` This is because the build_date from the header has a newline character as does the dev_info() print. As the firmware isn't guaranteed to always have a newline but the print is, copy the firmware build date to a temporary variable and strip any whitespace from it before showing it in the logs. Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> Link: https://patch.msgid.link/20251120155829.3494747-1-superm1@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent 7545551 commit f804a58

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3101,6 +3101,7 @@ int mt76_connac2_load_patch(struct mt76_dev *dev, const char *fw_name)
31013101
int i, ret, sem, max_len = mt76_is_sdio(dev) ? 2048 : 4096;
31023102
const struct mt76_connac2_patch_hdr *hdr;
31033103
const struct firmware *fw = NULL;
3104+
char build_date[17];
31043105

31053106
sem = mt76_connac_mcu_patch_sem_ctrl(dev, true);
31063107
switch (sem) {
@@ -3124,8 +3125,11 @@ int mt76_connac2_load_patch(struct mt76_dev *dev, const char *fw_name)
31243125
}
31253126

31263127
hdr = (const void *)fw->data;
3128+
strscpy(build_date, hdr->build_date, sizeof(build_date));
3129+
build_date[16] = '\0';
3130+
strim(build_date);
31273131
dev_info(dev->dev, "HW/SW Version: 0x%x, Build Time: %.16s\n",
3128-
be32_to_cpu(hdr->hw_sw_ver), hdr->build_date);
3132+
be32_to_cpu(hdr->hw_sw_ver), build_date);
31293133

31303134
for (i = 0; i < be32_to_cpu(hdr->desc.n_region); i++) {
31313135
struct mt76_connac2_patch_sec *sec;

0 commit comments

Comments
 (0)