[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/3] block: Add blk_new_with_bs() helper
From: |
Max Reitz |
Subject: |
Re: [PATCH v2 1/3] block: Add blk_new_with_bs() helper |
Date: |
Fri, 24 Apr 2020 16:25:19 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 24.04.20 16:18, Eric Blake wrote:
> On 4/24/20 5:02 AM, Max Reitz wrote:
>
>>> (With the Patchew warning fixed, of course (i.e., we should set ret to
>>> -EPERM or something in qcow.c))
>>
>> Er, well, maybe I should have looked into more places. The compiler
>> only warns about that single one because it’s the only place where @ret
>> is really uninitialized, but there are many more where we need to set
>> it: crypto.c, parallels.c, qcow.c, qcow2.c (both hunks), qed.c,
>> sheepdog.c, vdi.c, vhdx.c, and vpc.c.
>>
>> (So basically everywhere but vmdk.c, blockdev.c, and blockjob.c.)
>
> Urgh - so it's even less of a win in terms of reduced lines of code.
True, but I still consider it a win in terms of reduced complexity.
Before, we have two function calls with two variable assignments from
their return values (@blk and @ret). Afterwards, we’ll have a single
function all with one variable assignment from its return value (@blk),
and one stand-alone variable assignment with a constant value (“ret =
-EPERM” or similar). :)
Max
signature.asc
Description: OpenPGP digital signature
Re: [PATCH v2 1/3] block: Add blk_new_with_bs() helper, Stefan Hajnoczi, 2020/04/24
[PATCH v2 2/3] qcow2: Allow resize of images with internal snapshots, Eric Blake, 2020/04/23
Re: [PATCH v2 0/3] qcow2: Allow resize of images with internal snapshots, no-reply, 2020/04/23
Re: [PATCH v2 0/3] qcow2: Allow resize of images with internal snapshots, no-reply, 2020/04/23
Re: [PATCH v2 0/3] qcow2: Allow resize of images with internal snapshots, no-reply, 2020/04/23