Commit d1e61b86 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Kalle Valo

brcmfmac: treat NULL character in NVRAM as separator

Platform NVRAM (stored on a flash partition) has entries separated by a
NULL (\0) char. Our parsing code switches from VALUE state to IDLE
whenever it meets a NULL (\0). When that happens our IDLE handler should
simply consume it and analyze whatever is placed ahead.

This fixes harmless warnings spamming debugging output:
[  155.165624] brcmfmac: brcmf_nvram_handle_idle warning: ln=1:col=20: ignoring invalid character
[  155.180806] brcmfmac: brcmf_nvram_handle_idle warning: ln=1:col=44: ignoring invalid character
[  155.195971] brcmfmac: brcmf_nvram_handle_idle warning: ln=1:col=63: ignoring invalid character
Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent f66ab2a7
...@@ -93,7 +93,7 @@ static enum nvram_parser_state brcmf_nvram_handle_idle(struct nvram_parser *nvp) ...@@ -93,7 +93,7 @@ static enum nvram_parser_state brcmf_nvram_handle_idle(struct nvram_parser *nvp)
c = nvp->data[nvp->pos]; c = nvp->data[nvp->pos];
if (c == '\n') if (c == '\n')
return COMMENT; return COMMENT;
if (is_whitespace(c)) if (is_whitespace(c) || c == '\0')
goto proceed; goto proceed;
if (c == '#') if (c == '#')
return COMMENT; return COMMENT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment