qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/block/nvme: map prp fix if prp2 contains non-zero offset


From: Klaus Jensen
Subject: Re: [PATCH] hw/block/nvme: map prp fix if prp2 contains non-zero offset
Date: Fri, 9 Apr 2021 09:00:37 +0200

On Apr  9 06:38, Keith Busch wrote:
On Thu, Apr 08, 2021 at 09:53:13PM +0530, Padmakar Kalghatgi wrote:
+            /*
+             *   The first PRP list entry, pointed by PRP2 can contain
+             *   offsets. Hence, we need calculate the no of entries in
+             *   prp2 based on the offset it has.
+             */

This comment has some unnecessary spacing at the beginning.

+            nents = (n->page_size - (prp2 % n->page_size)) >> 3;

page_size is a always a power of two, so let's replace the costly modulo
with:

        nents = (n->page_size - (prp2 & (n->page_size - 1))) >> 3;


Good point.

I'll fix both issues and queue the patch.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]