coding guidelines: comply with MISRA Rule 2.2

- avoided dead stores

Signed-off-by: Hess Nathan <nhess@baumer.com>
This commit is contained in:
Hess Nathan 2024-04-29 15:29:43 +02:00 committed by Anas Nashif
parent 40a8022e4a
commit aa3e9c1d1e

View file

@ -143,7 +143,7 @@ static int vpf(struct _pfr *r, const char *f, va_list ap)
static inline int snprintf(char *buf, unsigned long len, const char *f, ...)
{
int ret = 0;
int ret;
struct _pfr r = { .buf = buf, .len = len };
CALL_VPF(&r);
@ -152,7 +152,7 @@ static inline int snprintf(char *buf, unsigned long len, const char *f, ...)
static inline int sprintf(char *buf, const char *f, ...)
{
int ret = 0;
int ret;
struct _pfr r = { .buf = buf, .len = 0x7fffffff };
CALL_VPF(&r);
@ -161,7 +161,7 @@ static inline int sprintf(char *buf, const char *f, ...)
static inline int printf(const char *f, ...)
{
int ret = 0;
int ret;
struct _pfr r = {0};
CALL_VPF(&r);