[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/7] block/vpc: Fix most coding style warnings a
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 1/7] block/vpc: Fix most coding style warnings and errors |
Date: |
Tue, 05 Feb 2013 11:20:51 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Am 01.02.2013 22:51, schrieb Stefan Weil:
> Only C99 comments remain unfixed.
>
> Signed-off-by: Stefan Weil <address@hidden>
> ---
> block/vpc.c | 94
> +++++++++++++++++++++++++++++++++--------------------------
> 1 file changed, 52 insertions(+), 42 deletions(-)
> @@ -578,8 +589,8 @@ static int calculate_geometry(int64_t total_sectors,
> uint16_t* cyls,
>
> static int create_dynamic_disk(int fd, uint8_t *buf, int64_t total_sectors)
> {
> - struct vhd_dyndisk_header* dyndisk_header =
> - (struct vhd_dyndisk_header*) buf;
> + struct vhd_dyndisk_header *dyndisk_header =
> + (struct vhd_dyndisk_header *)buf;
Please leave the space after the closing bracket.
> size_t block_size, num_bat_entries;
> int i;
> int ret = -EIO;
> @@ -709,8 +720,7 @@ static int vpc_create(const char *filename,
> QEMUOptionParameter *options)
> total_sectors = total_size / BDRV_SECTOR_SIZE;
> for (i = 0; total_sectors > (int64_t)cyls * heads * secs_per_cyl; i++) {
> if (calculate_geometry(total_sectors + i, &cyls, &heads,
> - &secs_per_cyl))
> - {
> + &secs_per_cyl)) {
> ret = -EFBIG;
> goto fail;
> }
This is not an improvement. CODING_STYLE says:
The opening brace is on the line that contains the control
flow statement that introduces the new block
It wasn't on the line of the "if" before the patch, and it isn't after
the patch (and it can't because of the 80 characters/line maximum, which
is probably the more important rule). I like the readabilty of the
existing version better.
Kevin
- [Qemu-devel] block/vpc: Code cleanup and bug fix, Stefan Weil, 2013/02/01
- [Qemu-devel] [PATCH 4/7] block/vpc: Improve vpc_open (optimisation and error handling), Stefan Weil, 2013/02/01
- [Qemu-devel] [PATCH 7/7] block/vpc: Use macros for magic constants, Stefan Weil, 2013/02/01
- [Qemu-devel] [PATCH 2/7] block/vpc: Add link to available VHD documentation, Stefan Weil, 2013/02/01
- [Qemu-devel] [PATCH 1/7] block/vpc: Fix most coding style warnings and errors, Stefan Weil, 2013/02/01
- Re: [Qemu-devel] [PATCH 1/7] block/vpc: Fix most coding style warnings and errors,
Kevin Wolf <=
- [Qemu-devel] [PATCH 5/7] block/vpc: Fix size calculation, Stefan Weil, 2013/02/01
[Qemu-devel] [PATCH 3/7] block/vpc: Replace HEADER_SIZE by FOOTER_SIZE, Stefan Weil, 2013/02/01
[Qemu-devel] [PATCH 6/7] block/vpc: Remove workaround for geometry calculation, Stefan Weil, 2013/02/01