Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1F98ECD6E4A for ; Wed, 3 Jun 2026 07:53:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1325819.1591164 (Exim 4.92) (envelope-from ) id 1wUgPS-0007Dn-Gh; Wed, 03 Jun 2026 07:53:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1325819.1591164; Wed, 03 Jun 2026 07:53:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wUgPS-0007Dg-Cv; Wed, 03 Jun 2026 07:53:06 +0000 Received: by outflank-mailman (input) for mailman id 1325819; Wed, 03 Jun 2026 07:53:05 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wUgPQ-0007Da-W4 for xen-devel@lists.xenproject.org; Wed, 03 Jun 2026 07:53:05 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wUgPQ-00HN9Z-3h for xen-devel@lists.xenproject.org; Wed, 03 Jun 2026 09:53:04 +0200 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a1fdd4a-2eae-0a2a0a5409dd-0a2a45048112-42 for ; Wed, 03 Jun 2026 09:53:04 +0200 Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 6a1fdd5f-1dec-0a2a45040019-d155802ff016-3 for ; Wed, 03 Jun 2026 09:53:03 +0200 Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-490af320e2aso24376165e9.2 for ; Wed, 03 Jun 2026 00:53:03 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4601f2e4004sm5601481f8f.9.2026.06.03.00.53.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jun 2026 00:53:02 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1780473183; x=1781077983; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=hQBbA0BeRSilHQju6MRDMgMQ34bh3W2P0XlO+6zEcG0=; b=aBDq4LSyv5U+EUpOA3g27B6a97LUyYgJmT8T+KBa3xQpEgrt2lrvpB1h+TX1rdO7Gs gs0lYvALpmA6GVmLzR/mG4qADAiaR6yoUqOBVMG//UwwZHRpwKRm5Du63J7Es/uCZeIG dojKsgFRdlDgU8Mx/yptI3KIRbJ1Y0rTQs3MTcAd1NReFXUI17nQLgv5XiThaNz//Hl9 KOs5SrdXWLUBvNOKH/K9gBdOSGH1/b9uUUBwrFLkTNCNNpqox0NDHTPb3y2XN/XVlBed NQCFnV1L8sk3JnaPFHENk+TplDvA5NupjfBSig0Rj75loUv2VvwM07RBmMtYnAbW5zl/ pTfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780473183; x=1781077983; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hQBbA0BeRSilHQju6MRDMgMQ34bh3W2P0XlO+6zEcG0=; b=CrZ1z0VS9oCdw6CzbdOz2MhLUVrUjRJdNe5D0fsEbWNSUz7mYbmL5UnJPt1XFDn5FS fQxEL5RRF5EB0843stpQHJINenqynmScC9AKGMbfrpWAN4VFjyRv8Top1qFDhIPG4kDh 4tDb5Nk8d6RzimAuzd6PC7Da2rMtRHXUpnmYGaNv0dhcpFnJdRiQmFSe6WL244S7Eq+F 64sq7MPv6LrD/8gle5NRiSEmH0VFuGQYRGXAvInwLz+qMuNLU6ZejP4cAVZciy3/uOiP YAQrP0NF6zzQ1CIzpBV0wG59l+LI1adiSr67tnTAqb1cZZv0rNwCxle65i03jJziXNG9 nWDg== X-Forwarded-Encrypted: i=1; AFNElJ+1AizgMXihR/OFHqQGeukYl+jGhhMOptFkoPMEuBTyWHooYb9eOtAaTSfepbOloothn4AfzrxbZDA=@lists.xenproject.org X-Gm-Message-State: AOJu0YzBlepkuzWea4bqCVh1R8tXxQEw7Y1pliN8W3jh15pmaJ6fwVYB kog8g/h0AFlifH1AR95ZqM5MqeGW9W3YV0be0srEmttwF8MLLKGuxQsfMA+KrqDbZQ== X-Gm-Gg: Acq92OEJge4CoU0lGPDlrfY18oQJNzLr8uvhEL4TGEccHOjdyFAflz82Q8meuPmS11L NRbmAbGzTSFyGpumY6AXj7wxD/gzFVFcrd0FRyqQtmbI9CVIoU69xwHeYXD7Xzeslf3GzWLmGLN lDM6NgeSNvatZ2l/Q3dXnauKLjxekr+dzIczG8PXJ1qU4fbcT0DEyDNxgVZnL1Lz/D2nDUlrO8C Fpp3H2qcRiqfAAqbH8ZJ0lqLn6FigPnv7UXQ8Hl++JvwWznFmOsMwaK69SkezgYPNrFoMvR1ChY tFnuDYRdO7lWaBOVqh/ui75Wi23EVrIkujVNIE0VVC/LaLZHn6HLkF+bDox5MvYF1zanDl+QxYH /oggM1+4QHCqQMhbcMH4rLpjxONFjQ2aRxO2vHZ3dEh8NvNZSlN0YuTMCKUpQJN3McVxOlGOdsr 7aVbCfhQ2GsI4lfAbLRHTrkfv8kqgZR8TIYAQQimuHVjXQCD/93Fm53ynfUTtvgpGP1ERyNe/1r er7cXSkzAReE15OQvHG8TOy0cCB8gpAyfK5 X-Received: by 2002:a05:600c:4e87:b0:490:9d1b:f05c with SMTP id 5b1f17b1804b1-490b60e3f91mr38110365e9.33.1780473183102; Wed, 03 Jun 2026 00:53:03 -0700 (PDT) Message-ID: Date: Wed, 3 Jun 2026 09:53:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] misra: deviate MISRA C Rule 5.5 for 'hypfs_alloc_dyndata' To: Dmytro Prokopchuk1 Cc: Nicola Vetrini , Doug Goldstein , Stefano Stabellini , Andrew Cooper , Anthony PERARD , Michal Orzel , Julien Grall , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , "xen-devel@lists.xenproject.org" References: Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5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5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-purgate-ID: tlsNG-ebf023/1780473183-42D643FF-54C0D61F/0/0 X-purgate-type: clean X-purgate-size: 2556 On 25.05.2026 14:05, Dmytro Prokopchuk1 wrote: > MISRA C Rule 5.5 states: "Identifiers shall be distinct from macro > names". > > Update ECLAIR configuration to deviate intentional identifier and > macro name clashes by specifying the macros that should be ignored. > This includes 'hypfs_alloc_dyndata', where the real function takes > an allocation size and the same-named macro is a typed convenience > wrapper that expands calls using sizeof(type). > > Update deviations.rst and rules.rst accordingly. > > Signed-off-by: Dmytro Prokopchuk While I'm okay with this approach, were alternatives considered? E.g. following the xmalloc() naming model, even if that has a name spacing issue (which ideally we wouldn't further extend)? > --- a/automation/eclair_analysis/ECLAIR/deviations.ecl > +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl > @@ -132,6 +132,12 @@ These macros address differences in argument count during compile-time, effectiv > -config=MC3A2.R5.5,ignored_macros+="name(update_gnttab_par||parse_gnttab_limit)&&loc(file(^xen/common/grant_table\\.c$))" > -doc_end > > +-doc_begin="Clash between 'hypfs_alloc_dyndata' function and macro name in 'xen/include/xen/hypfs.h' is deliberate. > +The function is the allocator taking a size in bytes, while the macro is a typed convenience wrapper used by dynamic > +hypfs nodes to allocate per-request traversal data with the correct size and return type." > +-config=MC3A2.R5.5,ignored_macros+="name(hypfs_alloc_dyndata)&&loc(file(^xen/include/xen/hypfs\\.h$))" > +-doc_end I think this is too verbose for the purposes here. The details can all be had ... > --- a/docs/misra/deviations.rst > +++ b/docs/misra/deviations.rst > @@ -176,6 +176,15 @@ Deviations related to MISRA C:2012 Rules: > unused 2nd and 3rd parameters to avoid warnings or errors related to them. > - ECLAIR has been configured to ignore these macros. > > + * - R5.5 > + - Clash between the 'hypfs_alloc_dyndata' function and macro name is > + intentional. The function is the allocator taking a size in bytes, while > + the macro is a typed convenience wrapper used by dynamic hypfs nodes to > + allocate per-request traversal data with the correct size and return type. > + The implementation explicitly undefines the macro before defining the real > + function, so the name clash is controlled. > + - ECLAIR has been configured to ignore this macro. ... from here. Jan