Thread (1 message) 1 message, 1 author, 2020-04-02

Re: [PATCH v5 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

From: Michael Ellerman <hidden>
Date: 2020-04-02 23:55:57
Also in: nvdimm

Vaibhav Jain [off-list ref] writes:
Thanks for reviewing this patch Mpe,
Michael Ellerman [off-list ref] writes:
quoted
Vaibhav Jain [off-list ref] writes:
...
quoted
quoted
+	/* Check for various masks in bitmap and set the buffer */
+	if (health & PAPR_SCM_DIMM_UNARMED_MASK)
+		rc += sprintf(buf, "not_armed ");
I know buf is "big enough" but using sprintf() in 2020 is a bit ... :)

seq_buf is a pretty thin wrapper over a buffer you can use to make this
cleaner and also handles overflow for you.

See eg. show_user_instructions() for an example.
Unfortunatly seq_buf_printf() is still not an exported symbol hence not
usable in external modules.
Send a patch? :)

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help