From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751344AbdJDJc2 (ORCPT ); Wed, 4 Oct 2017 05:32:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45066 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751114AbdJDJc1 (ORCPT ); Wed, 4 Oct 2017 05:32:27 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 906323D948 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=hdegoede@redhat.com Subject: Re: [PATCH] virt: Add vboxguest driver for Virtual Box Guest integration From: Hans de Goede To: Christoph Hellwig Cc: Arnd Bergmann , Greg Kroah-Hartman , Michael Thayer , "Knut St . Osmundsen" , Larry Finger , linux-kernel@vger.kernel.org References: <20171003092115.11341-1-hdegoede@redhat.com> <20171003092115.11341-2-hdegoede@redhat.com> <20171003100449.GA5491@infradead.org> Message-ID: Date: Wed, 4 Oct 2017 11:32:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 04 Oct 2017 09:32:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 03-10-17 13:41, Hans de Goede wrote: >>> +#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