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

Re: [PATCH] xen/treewide: More typeof() -> auto conversions


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 27 Jan 2026 17:10:57 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • 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=29EKGrTpStd6wnpmTvhslbg04JoVHcF9rqVLaHKnQ6g=; b=mDWjGdFCXN2yHP2VA+7xg7JuJf/cy9mjNow77j5zPj0ltRRhDU+8mqIl80OVIRYjHbfYNDJa4dfpWtKRK/0Ww+ss2E/i4rWXdyzl6bYH4ocSdXKIbe7+tnDJ/ZfeHPTeGE0dq3NfXJJXOBWllelXnIbF/rLgF9yJYe5HaWbSNUS+ZTLcpYjYEDCiyV/cEj0/L8TJuaLX9eeNRqw/E5d23xytgxK34cSeqHo0HoGKSQ6mSaQWaC91w7B466ObXJfu/pjV9PyCOwZN8wmrXfdFIXqI7Fm1lIA0/rozt2QvggyBvypXGPT5A5iqw5fyBy2b4ovYUlW5qd0p4QyeYPO5Mg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bF23f3ML7UJ1O0ljyYF5rJV5MAKxs15rPaytagg3X9c1EjYPPYK/9UkYitvB9XZg+IGPX5SsYzwLgVRcbQliYItYJEEpHr6ph4g4yaoF265y+YB/oNOYAvs9ero/esdna9hs5+pY2CuZBvLrvu64o729SlFdmSKRhWjj36T3pIKCQvz1NZuvimch+bi2TRnOe2Jeead+E45UIlHxRz+dM6dA9HJgdUAk/2csDIqa9TQsxSdjTwzU5uqHDaTGpabs/UN/fDKjgWLG8RA9x6mvADp72y4n8xxVZuvhKNEJids5iIHb6zzJ/ikyz15IH7gAa/y/CHddn9oT5T0yC/y9Jg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • 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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 27 Jan 2026 17:11:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27/01/2026 5:01 pm, Jan Beulich wrote:
> On 27.01.2026 11:18, Andrew Cooper wrote:
>> All of these are simple cases of using typeof() to avoid multiple parameter
>> evaluation.  Using auto avoids multiple textural expansion also.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Thanks.

While I've got people's attentions, there's a secondary pattern we use
that's a bit less clear to convert.

    typeof(a) *_ptr_a = &a;

With auto, you're required to write this as:

    auto _ptr_a = &a;

rather than the more-nomal-looking:

    auto *_ptr_a = &a;


So far I've only found two examples, and I'm debating leaving them as
are seeing as auto (in this form) is still a new concept to most.

Thoughts?

~Andrew



 


Rackspace

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