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

Re: [PATCH] xen/evtchn: Purge ERROR_EXIT{,_DOM}()


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 14 Jun 2023 08:59:14 +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=W/Uv8+2ut0pU8/8B7q7t2WByz98y1j7agDfdD1y5+ro=; b=hBU5CbB06lKDrzHqe7Bge/g3j5n3rYj1CzWVv0FfxBCwsLCXZU189lOMFQzdTt5xSiRRIUuxyWINqJJKaY7vY6AkN6dsvgpGjwU92rCF3JjBc6/F8LDvtlX1bRvA1pC9KkUuerUeEtf9snXufxvzxL89j8IIEzk8hEjynK+R+tZFcY6ulFr9tL3bpjuQRJLAS0nSdrT7j1ZO3IZJG9bIb948AxVzI1ygq200z4WB9FatDzY1lSjEZ4DA4biI3FX3d/t4PXQkGrhRm5QVOPscwsLg6mp6Qw+sFUBA6C3ei1+34tNGZEdIb4dIYgsNL3SO91+mAQ11+cqBmrHWUWg0HQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H5wFj/tvFAtS3AtTfMyhH5tjAdb0Ya2PZyIUTdZJSGxqnb7Pk7yP6Wp4VJwQWdaLj/wVkUaD9iJPOCai2hredMy2X8ktXaz3DCTHXSJ9LQHoCK/HNN2f2tBBbAoD7k2Sz/P1tDx7OgsCKHB1oKQPUpEikjBCkD6payZz2C4CQ0TbP1TRDa9WCtQP9VyKPSJUdpdSY3K2mYVYzamSbBSar7yAP6uLr7zHnijCXTxRP+JWyXCa7w4OoBqjAtoEcx+DhcZ6zuWLhkVS2kbV9C1bmScqks/JyGEO3fb21VOCw7nQL1Nwa7OTyo8F2BJjUPuNJFksUxwRAkrX/fywrWv+gQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 14 Jun 2023 06:59:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.06.2023 18:22, Andrew Cooper wrote:
> These are disliked specifically by MISRA, but they also interfere with code
> legibility by hiding control flow.  Expand and drop them.
> 
>  * Rearrange the order of actions to write into rc, then render rc in the
>    gdprintk().
>  * Drop redundant "rc = rc" assignments
>  * Switch to using %pd for rendering domains

With this change, ...

> No functional change.  Resulting binary is identical.

... I doubt this. Even .text being entirely identical would be pure luck,
as message offsets might change slightly depending on how much padding
the compiler inserts between them. Furthermore I wonder whether ...

> @@ -336,7 +319,11 @@ int evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc, 
> evtchn_port_t port)
>  
>      port = rc = evtchn_get_port(d, port);
>      if ( rc < 0 )
> -        ERROR_EXIT(rc);
> +    {
> +        gdprintk(XENLOG_WARNING, "EVTCHNOP failure: error %d\n", rc);
> +        goto out;
> +    }

... it wouldn't make sense to mention the actual operation that failed,
now that each function has its own message(s). In turn I question the
usesfulness of "error" in the message text.

Then again I wonder whether it isn't time to purge these gdprintk()s
altogether. Surely they served a purpose for bringing up initial Linux
and mini-os and alike, but that's been two decades ago now.

Jan



 


Rackspace

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