Contribute/BiteSizedTasks: Difference between revisions

From QEMU
No edit summary
Line 7: Line 7:
== Dead code removal ==
== Dead code removal ==
* hw/display contains files named *_template.h.  These are included many times with different values of the DEPTH macro.  However, only the DEPTH == 32 case is used.  Remove support for DEPTH != 32 in the template headers and in the file that include them.
* hw/display contains files named *_template.h.  These are included many times with different values of the DEPTH macro.  However, only the DEPTH == 32 case is used.  Remove support for DEPTH != 32 in the template headers and in the file that include them.
* Look for functions that are named *_exit or *_exitfn in hw/ and that return int.  They should all return zero.  Make them return void, and remove the checks for the callers.
* Once the above change is done, remove the "Error **" argument from functions named *_unrealize in hw/


== Testing & tools ==
== Testing & tools ==
* tests/qemu-iotests/*.out can have trailing spaces; make checkpatch.pl not complain about that
* tests/qemu-iotests/*.out can have trailing spaces; make checkpatch.pl not complain about that

Revision as of 13:55, 3 December 2014

API conversion

  • Look for uses of malloc, and convert them to either g_malloc, g_new (more rarely g_try_malloc or g_try_new if a lot of memory is being allocated). Likewise, convert calloc to either g_new0 or g_try_new0. Drop return value checks unless using g_try_new/g_try_new0.
  • Add checks for NULL return value to uses of load_image_targphys, qemu_find_file.
  • Add checks for negative return value to uses of get_image_size.
  • Associate external libraries with the object files that actually use them

Dead code removal

  • hw/display contains files named *_template.h. These are included many times with different values of the DEPTH macro. However, only the DEPTH == 32 case is used. Remove support for DEPTH != 32 in the template headers and in the file that include them.
  • Look for functions that are named *_exit or *_exitfn in hw/ and that return int. They should all return zero. Make them return void, and remove the checks for the callers.
  • Once the above change is done, remove the "Error **" argument from functions named *_unrealize in hw/

Testing & tools

  • tests/qemu-iotests/*.out can have trailing spaces; make checkpatch.pl not complain about that