Re: [PATCH] can: proc: fix rcvlist_* header alignment on 64-bit system

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

 



Hi,

On Sun, 25 Apr 2021 at 11:53, Erik Flodin <erik@xxxxxxxxx> wrote:
> -       seq_puts(m, "  device   can_id   can_mask  function"
> -                       "  userdata   matches  ident\n");
> +       seq_printf(m, "  device   can_id   can_mask  %sfunction%s  %suserdata%s   matches  ident\n",
> +                  pad, pad, pad, pad);
>  }

If a compile-time variant is better I'm happy to change this to e.g.
something like this:

seq_puts(m, "  device   can_id   can_mask  ");
if (IS_ENABLED(CONFIG_64BIT))
        seq_puts(m, "    function          userdata    ");
else
        seq_puts(m, "function  userdata");
seq_puts(m, "   matches  ident\n");

or something like what Vincent suggested:

#ifdef CONFIG_64BIT
#define PAD "    "
#else
#define PAD ""
#endif
...
seq_puts(m, "  device   can_id   can_mask  " PAD "function  " PAD
PAD "userdata   " PAD "matches  ident\n");

None of these versions are really grep friendly though. If that is
needed, a third variant with two full strings can be used instead.
Just let me know which one that's preferred.

// Erik



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux