Am 01.02.2013 22:51, schrieb Stefan Weil:
> Only C99 comments remain unfixed.
>
> Signed-off-by: Stefan Weil <[email protected]>
> ---
> 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