Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F321CC433E0 for ; Thu, 14 May 2020 12:12:29 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C24D1206A5 for ; Thu, 14 May 2020 12:12:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C24D1206A5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jZCig-0004H7-71; Thu, 14 May 2020 12:12:10 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jZCie-0004H2-OY for xen-devel@lists.xenproject.org; Thu, 14 May 2020 12:12:08 +0000 X-Inumbo-ID: 2169f896-95dc-11ea-a480-12813bfff9fa Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2169f896-95dc-11ea-a480-12813bfff9fa; Thu, 14 May 2020 12:12:07 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 06317B143; Thu, 14 May 2020 12:12:08 +0000 (UTC) Subject: Re: [PATCH v8 04/12] xen: add basic hypervisor filesystem support To: Jan Beulich References: <20200508153421.24525-1-jgross@suse.com> <20200508153421.24525-5-jgross@suse.com> <23938228-e947-fe36-8b19-0e89886db9ac@suse.com> From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Message-ID: <3ff40c34-e2ad-a821-a3ee-2222224cfece@suse.com> Date: Thu, 14 May 2020 14:12:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.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-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Andrew Cooper , Ian Jackson , George Dunlap , xen-devel@lists.xenproject.org, Daniel De Graaf , Volodymyr Babchuk , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 14.05.20 13:58, Jan Beulich wrote: > On 14.05.2020 11:50, Jürgen Groß wrote: >> On 14.05.20 09:59, Jan Beulich wrote: >>> On 08.05.2020 17:34, Juergen Gross wrote: >>>> +#define HYPFS_FIXEDSIZE_INIT(var, typ, nam, contvar, wr) \ >>>> +    struct hypfs_entry_leaf __read_mostly var = {        \ >>>> +        .e.type = typ,                                   \ >>>> +        .e.encoding = XEN_HYPFS_ENC_PLAIN,               \ >>>> +        .e.name = nam,                                   \ >>>> +        .e.size = sizeof(contvar),                       \ >>>> +        .e.max_size = wr ? sizeof(contvar) : 0,          \ >>>> +        .e.read = hypfs_read_leaf,                       \ >>>> +        .e.write = wr,                                   \ >>>> +        .content = &contvar,                             \ >>>> +    } >>> >>> At the example of this, some of the macros look like they want >>> parentheses added around uses of some of their parameters. >> >> Hmm, which ones? As I've understood from previous patch reviews by you >> you only want those parameters with parantheses where they are really >> needed. >> >> - var is a plain variable, so no parantheses >> - typ _should_ be a XEN_HYPFS_TYPE_* define, so probably no parantheses >>   (its usage in the macro doesn't call for using parantheses anyway) >> - nam might be a candidate, but I can't come up with a reason to put it >>   in parantheses here >> - contvar has to be a variable (otherwise sizeof(contvar) wouldn't >>   work), so no parantheses >> - wr is a function pointer or NULL, so no parantheses > > You have a point for uses as initializers, as there's no lower > precedence operator than the assignment ones except comma, > which would need parenthesizing in the macro invocation already. > However, I disagree on what you say about contvar and wr - > contvar is expected, but not required to be just an identifier. > And wr in turn is expected but not required to by an identifier > or NULL. I.e. the respective two lines where I think parentheses > can't be avoided are > > .e.max_size = (wr) ? sizeof(contvar) : 0, > > and > > .content = &(contvar), Okay. Juergen