Re: [PATCH v3 04/10] block: introduce dma map backed bio type

Christoph Hellwig <[email protected]>
Newsgroups org.kernel.vger.io-uring,org.infradead.lists.linux-nvme,org.kernel.vger.linux-block,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-media
Message-ID <[email protected]>
On Mon, May 18, 2026 at 11:29:54AM +0100, Pavel Begunkov wrote:
> On 5/13/26 09:19, Christoph Hellwig wrote:
>>> +	if (!bio_flagged(bio_src, BIO_DMABUF_MAP)) {
>>> +		bio->bi_io_vec = bio_src->bi_io_vec;
>>> +	} else {
>>> +		bio->dmabuf_map = bio_src->dmabuf_map;
>>> +		bio_set_flag(bio, BIO_DMABUF_MAP);
>>> +	}
>>
>> This is backwards, please avoid pointless negations:
>
> I can flip it, but compilers tend to prefer the true branch. E.g. this

What kind of compiler optimization do you expect from code where
both sides of the conditional assign different arms of the same union
and just propagate the bit that was set?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.