Re: [PATCH net-next 1/5] netdevice: convert private flags > BIT(31) to bitfields

From: Alexander Lobakin
Date: Thu Jun 27 2024 - 05:49:13 EST


From: Jakub Kicinski <kuba@xxxxxxxxxx>
Date: Wed, 26 Jun 2024 07:54:21 -0700

> On Tue, 25 Jun 2024 13:44:28 +0200 Alexander Lobakin wrote:
>> - "%s VID: %d REORDER_HDR: %i dev->priv_flags: %llx\n",
>> + "%s VID: %d REORDER_HDR: %i dev->priv_flags: %x\n",
>
> compiler says %lx
>
> net/8021q/vlanproc.c: In function ‘vlandev_seq_show’:
> net/8021q/vlanproc.c:241:69: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘long unsigned int’ [-Wformat=]
> 241 | "%s VID: %d REORDER_HDR: %i dev->priv_flags: %x\n",
> | ~^
> | |
> | unsigned int
> | %lx
> 242 | vlandev->name, vlan->vlan_id,
> 243 | (int)(vlan->flags & 1), vlandev->priv_flags);
> | ~~~~~~~~~~~~~~~~~~~
> | |
> | long unsigned int

Yeah, GCC wants %lx here, but Clang wants %x since priv_flags is
declared as long:32 >_<
I think I'll add a cast here.

Thanks,
Olek