[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 12 Dec 2022 11:28:06 -0800
From: Bart Van Assche <bvanassche@....org>
To: "Jiri Slaby (SUSE)" <jirislaby@...nel.org>
Cc: linux-kernel@...r.kernel.org, Martin Liska <mliska@...e.cz>,
Jason Gunthorpe <jgg@...pe.ca>,
Leon Romanovsky <leon@...nel.org>, linux-rdma@...r.kernel.org
Subject: Re: [PATCH v2] RDMA/srp (gcc13): move large values to a new enum
On 12/12/22 04:04, Jiri Slaby (SUSE) wrote:
> Since gcc13, each member of an enum has the same type as the enum [1]. And
> that is inherited from its members. Provided these two:
> SRP_TAG_NO_REQ = ~0U,
> SRP_TAG_TSK_MGMT = 1U << 31
> all other members are unsigned ints.
>
> Esp. with SRP_MAX_SGE and SRP_TSK_MGMT_SQ_SIZE and their use in min(),
> this results in the following warnings:
> include/linux/minmax.h:20:35: error: comparison of distinct pointer types lacks a cast
> drivers/infiniband/ulp/srp/ib_srp.c:563:42: note: in expansion of macro 'min'
>
> include/linux/minmax.h:20:35: error: comparison of distinct pointer types lacks a cast
> drivers/infiniband/ulp/srp/ib_srp.c:2369:27: note: in expansion of macro 'min'
>
> So move the large values away to a separate enum, so that they don't
> affect other members.
Reviewed-by: Bart Van Assche <bvanassche@....org>
Powered by blists - more mailing lists