Subject: build failure of next-20220811 due to d79b32c2e4a4 ("vdpa_sim_blk: add support for discard and write-zeroes")

From: "Sudip Mukherjee (Codethink)" <[email-masked]>
Date: Thu, 11 Aug 2022 18:22:54 +0100

Hi All,

Not sure if it has been reported, builds of arm64 with clang failed to
build next-20220811 with the error:

drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:201:3: error: expected expression
                struct virtio_blk_discard_write_zeroes range;
                ^
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:204:25: error: use of undeclared identifier 'range'
                if (to_pull != sizeof(range)) {
                                      ^
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:207:21: error: use of undeclared identifier 'range'
                                to_pull, sizeof(range));
                                                ^
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:212:60: error: use of undeclared identifier 'range'
                bytes = vringh_iov_pull_iotlb(&vq->vring, &vq->out_iov, &range,
                                                                         ^
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:222:38: error: use of undeclared identifier 'range'
                sector = vdpasim64_to_cpu(vdpasim, range.sector);
                                                   ^
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:224:43: error: use of undeclared identifier 'range'
                num_sectors = vdpasim32_to_cpu(vdpasim, range.num_sectors);
                                                        ^
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:225:37: error: use of undeclared identifier 'range'
                flags = vdpasim32_to_cpu(vdpasim, range.flags);
                                                  ^
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:202:7: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
                u32 num_sectors, flags;
                    ^
8 errors generated.

git bisect pointed to d79b32c2e4a4 ("vdpa_sim_blk: add support for discard and write-zeroes").
And, reverting that commit has fixed the build failure.

I will be happy to test any patch or provide any extra log if needed.

--
Regards
Sudip