Re: [PATCH v2 3/3] tty: Replace goldfish_tty_line_count with a #define

From: Alan Cox
Date: Thu Aug 02 2018 - 12:03:20 EST


On Tue, 24 Jul 2018 17:51:33 -0700
rkir@xxxxxxxxxx wrote:

> From: Roman Kiryanov <rkir@xxxxxxxxxx>
>
> The driver never mutates this variable - no benefits of
> keeping it mutable.
>
> Signed-off-by: Roman Kiryanov <rkir@xxxxxxxxxx>
> ---
> Changes in v2:
> - Replaced "const u32" with "#define".

v1 was IMHO definitely better. And you are correct that gcc will not
allocate memory for a static const object unless you do things like take
its address. It will (unlike a define) however properly typecheck
everything.

Alan