Re: [patch 2/7] CAN: Add PF_CAN core module

Arnaldo Carvalho de Melo
2007-05-16T20:51:03Z

On 16 May 2007 21:14:20 +0200, Urs Thuermann <urs@isnogud.escape.de> wrote:
> "Arnaldo Carvalho de Melo" <acme@ghostprotocols.net> writes:
>
> > Can can_ifindex be turned into a unsigned short? That way we would
> > have it nicely packed, avoiding this hole:
>
> Since dev->ifindex is int and we have many assignments between
> can_ifindex and dev->ifindex it would not make sense to define
> can_ifindex as a short int. Also in user space, ifindex is int,
> e.g. in struct ifreq. This would cause implicit truncating type casts
> from int to short int (some compilers warn about this, haven't tried
> GCC for a long time) or require many explicit type casts.

Quick answer, thank you.

- Arnaldo