[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250305143814.GA18852@lst.de>
Date: Wed, 5 Mar 2025 15:38:14 +0100
From: Christoph Hellwig <hch@....de>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Christoph Hellwig <hch@....de>,
Caleb Sander Mateos <csander@...estorage.com>,
Keith Busch <kbusch@...nel.org>, Jens Axboe <axboe@...nel.dk>,
Sagi Grimberg <sagi@...mberg.me>, Hannes Reinecke <hare@...e.de>,
linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] nvme-tcp: fix signedness bug in
nvme_tcp_init_connection()
On Wed, Mar 05, 2025 at 05:37:15PM +0300, Dan Carpenter wrote:
> > if (ret >= 0 && ret < sizeof(*icresp))
> > ret = -ECONNRESET;
> > if (ret < 0) {
> > ...
>
> Sure, I can do that.
>
> I don't love casts either. I normally have tried to write these as
> "if (ret < 0 || ret < sizeof(*icresp)) {" and people don't love that.
I can see why people don't like it as it's really counterintuitive.
These kinds of interfaces just suck given the type promotion rules
unfortunately.
Powered by blists - more mailing lists