Re: [PATCH] virt: Add vboxguest driver for Virtual Box Guest integration

From: Hans de Goede
Date: Wed Oct 04 2017 - 05:32:33 EST


Hi,

On 03-10-17 13:41, Hans de Goede wrote:

<snip>

+#define CHECK_IOCTL_IN(req)ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ \
+do {ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ \
+ÂÂÂ if ((req)->Hdr.cbIn != (sizeof((req)->Hdr) + sizeof((req)->u.In)) || \
+ÂÂÂÂÂÂÂ (req)->Hdr.cbOut != sizeof((req)->Hdr))ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ \
+ÂÂÂÂÂÂÂ return -EINVAL;ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ \
+} while (0)

Make these things functions instead of macros.

Turning these into functions is a good idea I will do so for v2.

Correction, I forgot that the passed in "req" macro
argument has a different type with all the calls, so
these cannot be changed into functions because they
rely on sizeof on the specific type to do the size
checks.

Regards,

Hans