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

Re: [XEN PATCH] xen/types: address Rule 10.1 for macro BITS_TO_LONGS


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 8 Sep 2023 13:59:38 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=aTYsfaMjEWskN4vEb2EkYfNw05s+SB4EQKcMrJtcfyY=; b=QnSkfIJsUSbdY3exjhXfDEvVPU3zf+tn+/bQcfMzeWVFSRx8XGVatC/6E6I6LfQVKpiYpAyq75eQgBtxnPvlMbs8r5c6YGq51cmQrc2rs3Ful1mjnVw5skT+ZHhqFykOzixmKK2njJbTxgxJmeut9Rw9cCOpMQDBQblE2+C5d9cqMZn6zjp0dbcqOAqtXCSC5AHbox8wUCTWZAYmdoXum56UEvSClBDq8p4yjJIWvUuG9qZP74jANiH/NwFfrVRVjubKosJw5Ri9G6NykdC49xCXFcUmW2p5DF94WcSMpsFsUN55tHOOsN/eEo8cl9MHk48FPte7eCy5dLYQck9bqQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UrEcbNQ01rwpA9zBz1hsW5npB1Q+ELEc+wgS6/BzP4i8kVB7huEX2UYcVCK1qIX4/SolLt0vcTfokzKtlVBupVFsF6L400y5gVbxf5CHy+1SkKK+FtXO9k2Q2Lf9mlKTSijnDy41CnZYvDF02JaMwp7vRdEQPv5juzgGfuqRnaGY6CKJmqGEOncl2xpIijxienNqNq6a41oTaeanNvj6TJoV+2RK/s2PjVEDppWf8adj1y81bKdPyTdLQwO6prVH7Ve63yynq3NJugZ99lvV/yS9ZcjrWMU70FZEzSsqDSaR2d+QRv2gPc5NCWyurgkACci0iVue+94wnPzhcobk6A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: michal.orzel@xxxxxxx, xenia.ragiadakou@xxxxxxx, ayan.kumar.halder@xxxxxxx, consulting@xxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Fri, 08 Sep 2023 11:59:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.09.2023 13:57, Jan Beulich wrote:
> On 08.09.2023 10:48, Nicola Vetrini wrote:
>> There is a build error due to -Werror because of a pointer comparison at 
>> line 469 of common/numa.c:
>> i = min(PADDR_BITS, BITS_PER_LONG - 1);
>> where
>> #define PADDR_BITS              52
>>
>> I guess PADDR_BITS can become unsigned or gain a cast
> 
> While generally converting constants to unsigned comes with a certain
> risk, I think for this (and its siblings) this ought to be okay. As to
> the alternative of a cast - before considering that, please consider
> e.g. adding 0u (as we do elsewhere in the code base to deal with such
> cases).

And just after sending I realized that this would still be disliked by
Misra's type system. (Much like then aiui the 1 above will need to
become 1u. Which is all pretty horrible.)

Jan



 


Rackspace

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