[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/3] block/nvme: Initialize constant values with const_le32()
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH 1/3] block/nvme: Initialize constant values with const_le32() |
Date: |
Thu, 17 Sep 2020 10:55:21 +0100 |
On Wed, Sep 16, 2020 at 10:40:02PM +0200, Philippe Mathieu-Daudé wrote:
> To avoid multiple endianess conversion, as we know the device
> registers are in little-endian, directly use const_le32() with
> constant values.
Can cpu_to_X() be extended to handle constant expressions? That way the
programmer doesn't need to remember the const_X() API exists.
Maybe __builtin_constant_p() can be used:
https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fconstant_005fp
signature.asc
Description: PGP signature