Skip to content

Commit 4991eef

Browse files
XenuIsWatchinghenrikbrixandersen
authored andcommitted
drivers: i3c: ccc: use SIZEOF_FIELD
Use the SIZEOF_FIELD macro to make things look prettier. Signed-off-by: Ryan McClelland <[email protected]>
1 parent 6e271cf commit 4991eef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/i3c/i3c_ccc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,14 +860,14 @@ int i3c_ccc_do_getmxds(const struct i3c_device_desc *target,
860860
len = ccc_tgt_payload.num_xfer;
861861

862862
if ((fmt == GETMXDS_FORMAT_1) || (fmt == GETMXDS_FORMAT_2)) {
863-
if (len == sizeof(((union i3c_ccc_getmxds *)0)->fmt1)) {
863+
if (len == SIZEOF_FIELD(union i3c_ccc_getmxds, fmt1)) {
864864
mxds->fmt1.maxwr = data[0];
865865
mxds->fmt1.maxrd = data[1];
866866
/* It is unknown wither format 1 or format 2 is returned ahead of
867867
* time
868868
*/
869869
memset(&mxds->fmt2.maxrdturn, 0, sizeof(mxds->fmt2.maxrdturn));
870-
} else if (len == sizeof(((union i3c_ccc_getmxds *)0)->fmt2)) {
870+
} else if (len == SIZEOF_FIELD(union i3c_ccc_getmxds, fmt2)) {
871871
mxds->fmt2.maxwr = data[0];
872872
mxds->fmt2.maxrd = data[1];
873873
memcpy(&mxds->fmt2.maxrdturn, &data[2],

0 commit comments

Comments
 (0)