[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 4/6] rangeset: introduce rangeset_subtract


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Tue, 13 May 2025 13:01:24 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=30MnAZhpTp4Df94mweho2LyHvUayV6y9u7bd0wWM2WA=; b=W7RRGS6ButxoP/TxJ/X/pq7MdNdA3p6afjwBkvHlDgpAtFI3gNdET0F4yg8hZZUs1fOrzDlmBx8qnF+3LTPDYzX7R2FqIiRvQUqTtV+tKwue6m5CwORkAaBycVhBvWBfXhBWTVoi6dbZ16l62R+8XvzHlU7Cc0Yp0IisFCXftevHpUgwQpeHqK9yamHhdkPxsrqgq9Jdb6S9DORqHc9HhKNRiLRzvG2QF1nK/+LrXAKyIfh52J8CmXN2czPJIlroFAN0LF99c4ZRLjQ3mFiVckiL1E6++GdLCnCTAuF0hzFSBP2vgCfpmfZ5s6+rgCP9EJFdLxGpB/zxoQrqP0DSpQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F3jAyDo38JUsnmTZJ0ZXPUmQ+MRZpQxnDEvffTrI4A6fM204jiqd6OhWrtlFFc9hjP1fRpz0Gd+8OXkNf+c+hHrBYTMZ9zOhj4M/GTe3H7B/0dVUJF4/7zGIvwznaYLC19lpWeWIwvfj8i9cJyHGRYuNiFC+yNR+hROk8TxWhisQz2A6Vv1lGPqXLjYC7bjPKHaqJwh41GTHkXouZXJfAVxtBwQdO3nbJVf4VZS6Tx4Rz1AMl/4cQFmFa3WaOmurk4qw6Y+W2aYt2H022htsOlCXRPBexJPL9jWU88vTJ3h/G8UlTrOXx7B9BXLj988Jqk2jIzTNT3NJuR2AbdLu8Q==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 13 May 2025 17:01:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.