Re: [PATCH v6 13/15] net: qrtr: limit endpoint range to 16 bits on 32-bit machines

From: David Laight

Date: Sat Sep 05 2026 - 06:11:09 EST


On Sat, 05 Sep 2026 07:21:33 +0300
"Juha-Matti Tilli" <juha-matti.tilli@xxxxxx> wrote:

> On Sat, Sep 5, 2026, at 04:40, Jakub Kicinski wrote:
> > On Tue, 1 Sep 2026 16:19:32 +0300 Juha-Matti Tilli wrote:
> > > On 64-bit machines, use the full range for endpoint ids, but on 32-bit
> > > machines, use only 16 bits. This gives plenty of endpoints, 65534 to
> > > be specific, apart from the invalid zero value and the local endpoint.
> > >
> > > [snip]
> >
> > Doesn't build on 32bit x86:
> >
> > ../net/qrtr/af_qrtr.c: In function ‘qrtr_endpoint_register’:
> > ../net/qrtr/af_qrtr.c:28:58: error: ‘UINT16_MAX’ undeclared (first use in this function)
> > 28 | #define QRTR_ENDPOINT_RANGE XA_LIMIT(qrtr_local_nid + 1, UINT16_MAX)
> > [snip]
>
> Indeed, I will later post a new version with UINT16_MAX replaced by
> 65535.

Makes more sense anyway because it is an arbitrary bound (rather than
ensuring the result will fit in 16 bits.
Indeed, it might be better to use a different limit.

David

>
> I thought I was careful testing these, but now I recall that the
> individual patches were test-compiled on 64-bit and only the branch
> head with all patches was tested on 32-bit.
>
> Thanks for noticing!
>
> BR, Juha-Matti
>