qemu-devel
[Top][All Lists]
Advanced

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

Re: [for-8.0 v2 05/11] cryptodev: Introduce 'query-cryptodev' QMP comman


From: Thomas Huth
Subject: Re: [for-8.0 v2 05/11] cryptodev: Introduce 'query-cryptodev' QMP command
Date: Wed, 18 Jan 2023 11:58:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 18/01/2023 11.29, Daniel P. Berrangé wrote:
On Wed, Jan 18, 2023 at 05:25:37AM -0500, Michael S. Tsirkin wrote:
On Mon, Jan 16, 2023 at 11:18:19AM +0000, Daniel P. Berrangé wrote:
+    for (uint32_t i = 0; i < QCRYPTODEV_BACKEND_SERVICE__MAX; i++) {

QEMU coding style doesn't declare types inside the for() control
conditions. I'd suggest 'size_t i', and put it at top of this
function.

It's actually kind of vague:

        Mixed declarations (interleaving statements and declarations within
        blocks) are generally not allowed; declarations should be at the 
beginning
        of blocks.

for loop starts a block, does it not?

I wasn't refering to the specific docs per-se, but rather that no
code does this at all in QEMU. It is effectively our style, even
if not documented as such

$ grep -r 'for (int ' * | wc -l
381

... we're using it in many places already, and I think it should be OK since we started using gnu99 and later as a base standard. Just my 0.02 cents.

 Thomas




reply via email to

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