SMBIOS: Avoid sizeof
on struct type
Where applicable, use the size of the associated variable. Change-Id: Ibbac2a82893232a6f87182a6a965b84a599d633e Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55904 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
This commit is contained in:
committed by
Patrick Georgi
parent
c6dab80b1c
commit
35b99c64e6
@ -18,9 +18,9 @@ static int smbios_write_intel_wifi(struct device *dev, int *handle, unsigned lon
|
||||
} __packed;
|
||||
|
||||
struct smbios_type_intel_wifi *t = (struct smbios_type_intel_wifi *)*current;
|
||||
int len = sizeof(struct smbios_type_intel_wifi);
|
||||
int len = sizeof(*t);
|
||||
|
||||
memset(t, 0, sizeof(struct smbios_type_intel_wifi));
|
||||
memset(t, 0, sizeof(*t));
|
||||
t->type = 0x85;
|
||||
t->length = len - 2;
|
||||
t->handle = *handle;
|
||||
|
Reference in New Issue
Block a user