Re: [kvm-devel] [kvm-ppc-devel] [PATCH 3 of 7] Create new load_uimage() gunzip support to uboot loader in Qemu

2008-03-18 Thread Hollis Blanchard
On Tue, 2008-03-18 at 15:06 -0500, Jerone Young wrote:
 +tmp_loaded_image_size = hdr-ih_size;
 +
 +if (hdr-ih_comp == IH_COMP_GZIP) {
 +   uncompressed_data = qemu_malloc(MAX_KERNEL_SIZE);
 +   ret = gunzip(uncompressed_data, MAX_KERNEL_SIZE,
 +(unsigned char *) data, 
 +tmp_loaded_image_size);
 +
 +   if (ret  0) {
 +fprintf(stderr, Unable to decompress gziped image!\n);
 +goto fail;
 +}
 +
 +qemu_free(data);
 +cpu_physical_memory_write_rom(hdr-ih_load, uncompressed_data,
 +  tmp_loaded_image_size);
 +
 +}
 +else {
 +cpu_physical_memory_write_rom(hdr-ih_load, data, 
 +  tmp_loaded_image_size);
 +}
 +
 +if (loaded_image_size != NULL)
 +*loaded_image_size = tmp_loaded_image_size;
 +   
 +if ( load_address != NULL)
 +   *load_address = hdr-ih_load;

Your whitespace in here is all over the place. Please fix.

-- 
Hollis Blanchard
IBM Linux Technology Center


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [kvm-ppc-devel] [PATCH 3 of 7] Create new load_uimage() gunzip support to uboot loader in Qemu

2008-03-18 Thread Jerone Young
On Tue, 2008-03-18 at 16:14 -0500, Hollis Blanchard wrote:
 On Tue, 2008-03-18 at 15:06 -0500, Jerone Young wrote:
  +tmp_loaded_image_size = hdr-ih_size;
  +
  +if (hdr-ih_comp == IH_COMP_GZIP) {
  +   uncompressed_data = qemu_malloc(MAX_KERNEL_SIZE);
  +   ret = gunzip(uncompressed_data, MAX_KERNEL_SIZE,
  +(unsigned char *) data, 
  +tmp_loaded_image_size);
  +
  +   if (ret  0) {
  +fprintf(stderr, Unable to decompress gziped image!
 \n);
  +goto fail;
  +}
  +
  +qemu_free(data);
  +cpu_physical_memory_write_rom(hdr-ih_load,
 uncompressed_data,
  +  tmp_loaded_image_size);
  +
  +}
  +else {
  +cpu_physical_memory_write_rom(hdr-ih_load, data, 
  +  tmp_loaded_image_size);
  +}
  +
  +if (loaded_image_size != NULL)
  +*loaded_image_size = tmp_loaded_image_size;
  +   
  +if ( load_address != NULL)
  +   *load_address = hdr-ih_load;
 
 Your whitespace in here is all over the place. Please fix.

Actually this matches the style of this entire file. I see the one white
space. I see also I used a tab one place.

The problem is there is no set style in qemu. So I followed the style of
the already created file.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [kvm-ppc-devel] [PATCH 3 of 7] Create new load_uimage() gunzip support to uboot loader in Qemu

2008-03-18 Thread Hollis Blanchard
On Tue, 2008-03-18 at 16:46 -0500, Jerone Young wrote:
 On Tue, 2008-03-18 at 16:14 -0500, Hollis Blanchard wrote:
  On Tue, 2008-03-18 at 15:06 -0500, Jerone Young wrote:
   +tmp_loaded_image_size = hdr-ih_size;
   +
   +if (hdr-ih_comp == IH_COMP_GZIP) {
   +   uncompressed_data = qemu_malloc(MAX_KERNEL_SIZE);
   +   ret = gunzip(uncompressed_data, MAX_KERNEL_SIZE,
   +(unsigned char *) data, 
   +tmp_loaded_image_size);
   +
   +   if (ret  0) {
   +fprintf(stderr, Unable to decompress gziped image!
  \n);
   +goto fail;
   +}
   +
   +qemu_free(data);
   +cpu_physical_memory_write_rom(hdr-ih_load,
  uncompressed_data,
   +  tmp_loaded_image_size);
   +
   +}
   +else {
   +cpu_physical_memory_write_rom(hdr-ih_load, data, 
   +  tmp_loaded_image_size);
   +}
   +
   +if (loaded_image_size != NULL)
   +*loaded_image_size = tmp_loaded_image_size;
   +   
   +if ( load_address != NULL)
   +   *load_address = hdr-ih_load;
  
  Your whitespace in here is all over the place. Please fix.
 
 Actually this matches the style of this entire file. I see the one white
 space. I see also I used a tab one place.

You switch from 8-space indentation in gunzip() to 4-space in
load_uimage(), and then things go *really* screwy around Unable to
decompress gziped image (which you spelled wrong btw). It looks like
you alternate between 4- and 3-space indentation after that. That does
NOT match the style of the rest of the file.

As for the if (  syntax, there are only a handful of people doing it
that way in the whole qemu tree, and more importantly, none of them are
in our code.

-- 
Hollis Blanchard
IBM Linux Technology Center


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel