Re: [PATCH v2] staging: vt6655: use memset to make code clearer

From: Nam Cao
Date: Fri Sep 09 2022 - 07:30:04 EST


On Fri, Sep 9, 2022 at 12:23 PM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> Why do you have to cast this to (void *)? That should almost never be
> needed.

Because I want to suppress a compiler warning:
drivers/staging/vt6655/device_main.c:869:9: warning: passing argument
1 of ‘memset’ discards ‘volatile’ qualifier from pointer target type
[-Wdiscarded-qualifiers]
869 | memset(&rd->rd0, 0, sizeof(rd->rd0));
| ^~~~~~~~

Best regards,
Nam