All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Julien Grall" <julien@xen.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 4/6] rangeset: introduce rangeset_subtract
Date: Tue, 13 May 2025 13:01:24 -0400	[thread overview]
Message-ID: <914a4bc2-aa18-478f-b175-b89b56beaf3b@amd.com> (raw)
In-Reply-To: <46dfb68b-7e94-40a8-9900-883ac899346e@suse.com>

On 5/13/25 11:39, Jan Beulich wrote:
> On 08.05.2025 15:20, Stewart Hildebrand wrote:
>> --- a/xen/common/rangeset.c
>> +++ b/xen/common/rangeset.c
>> @@ -397,6 +397,18 @@ int rangeset_merge(struct rangeset *r1, struct rangeset *r2)
>>      return rangeset_report_ranges(r2, 0, ~0UL, merge, r1);
>>  }
>>  
>> +static int cf_check subtract(unsigned long s, unsigned long e, void *data)
>> +{
>> +    struct rangeset *r = data;
>> +
>> +    return rangeset_remove_range(r, s, e);
>> +}
>> +
>> +int rangeset_subtract(struct rangeset *r1, struct rangeset *r2)
>> +{
>> +    return rangeset_report_ranges(r2, 0, ~0UL, subtract, r1);
>> +}
> 
> I understand this was committed already, but I don't understand why: This
> introduces a Misra rule 2.1 violation aiui. The rule isn't tagged as clean
> yet, but it was accepted and hence I thought we would strive towards not
> introducing new violations. What's the deal?
> 
> Jan

The very next patch (also committed) makes use of the function, so the
series as a whole did not introduce a violation. Our code review
guidelines still say to organize new independent helper functions into
logically separate patches [0]. To be clear, and for future reference,
would your expectation be to squash the introduction of the helper
function into the patch where it's used? Perhaps we ought to finally
update the code review guidelines...

[0] https://xenbits.xenproject.org/governance/code-review-guide.html


  reply	other threads:[~2025-05-13 17:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08 13:20 [PATCH v2 0/6] arm: extended regions fixes Stewart Hildebrand
2025-05-08 13:20 ` [PATCH v2 1/6] xen/arm: fix math in add_ext_regions Stewart Hildebrand
2025-05-14  7:47   ` Julien Grall
2025-05-08 13:20 ` [PATCH v2 2/6] xen/arm: fix math in add_hwdom_free_regions Stewart Hildebrand
2025-05-08 13:20 ` [PATCH v2 3/6] xen/arm: switch find_domU_holes to rangesets Stewart Hildebrand
2025-05-08 13:20 ` [PATCH v2 4/6] rangeset: introduce rangeset_subtract Stewart Hildebrand
2025-05-08 23:42   ` Stefano Stabellini
2025-05-13 15:39   ` Jan Beulich
2025-05-13 17:01     ` Stewart Hildebrand [this message]
2025-05-14  6:15       ` Jan Beulich
2025-05-15  8:52   ` Roger Pau Monné
2025-05-08 13:20 ` [PATCH v2 5/6] xen/arm: exclude xen,reg from domU extended regions Stewart Hildebrand
2025-05-08 23:39   ` Stefano Stabellini
2025-05-09  6:54   ` Orzel, Michal
2025-05-12 19:55     ` Stewart Hildebrand
2025-05-13  6:39       ` Orzel, Michal
2025-05-08 13:20 ` [PATCH v2 6/6] tools/arm: exclude iomem " Stewart Hildebrand
2025-05-30  0:31   ` Stefano Stabellini
2025-06-03  0:38   ` Stefano Stabellini
2025-06-03  6:33     ` Orzel, Michal
2025-06-03 18:12       ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=914a4bc2-aa18-478f-b175-b89b56beaf3b@amd.com \
    --to=stewart.hildebrand@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.