Alistair Francis <alistair.fran...@xilinx.com> writes: > Convert all the multi-line uses of fprintf(stderr, "warning:"..."\n"... > to use warn_report() instead. This helps standardise on a single > method of printing warnings to the user. > > All of the warnings were changed using these commands: > find ./* -type f -exec sed -i \ > 'N; {s|fprintf(.*".*warning[,:] > \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \ > {} + > find ./* -type f -exec sed -i \ > 'N;N; {s|fprintf(.*".*warning[,:] > \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \ > {} + > find ./* -type f -exec sed -i \ > 'N;N;N; {s|fprintf(.*".*warning[,:] > \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \ > {} + > find ./* -type f -exec sed -i \ > 'N;N;N;N {s|fprintf(.*".*warning[,:] > \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \ > {} + > find ./* -type f -exec sed -i \ > 'N;N;N;N;N {s|fprintf(.*".*warning[,:] > \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \ > {} + > find ./* -type f -exec sed -i \ > 'N;N;N;N;N;N {s|fprintf(.*".*warning[,:] > \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \ > {} + > find ./* -type f -exec sed -i \ > 'N;N;N;N;N;N;N; {s|fprintf(.*".*warning[,:] > \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \ > {} + > > Indentation fixed up manually afterwards. > > Some of the lines were manually edited to reduce the line length to below > 80 charecters. Some of the lines with newlines in the middle of the > string were also manually edit to avoid checkpatch errrors. > > The #include lines were manually updated to allow the code to compile. > > Signed-off-by: Alistair Francis <alistair.fran...@xilinx.com> > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc: Kevin Wolf <kw...@redhat.com> > Cc: Max Reitz <mre...@redhat.com> > Cc: "Michael S. Tsirkin" <m...@redhat.com> > Cc: Igor Mammedov <imamm...@redhat.com> > Cc: Peter Maydell <peter.mayd...@linaro.org> > Cc: Stefano Stabellini <sstabell...@kernel.org> > Cc: Anthony Perard <anthony.per...@citrix.com> > Cc: Richard Henderson <r...@twiddle.net> > Cc: Eduardo Habkost <ehabk...@redhat.com> > Cc: Aurelien Jarno <aurel...@aurel32.net> > Cc: Yongbok Kim <yongbok....@imgtec.com> > Cc: Cornelia Huck <coh...@redhat.com> > Cc: Christian Borntraeger <borntrae...@de.ibm.com> > Cc: Alexander Graf <ag...@suse.de> > Cc: Jason Wang <jasow...@redhat.com> > Cc: David Gibson <da...@gibson.dropbear.id.au> > Cc: Gerd Hoffmann <kra...@redhat.com> > --- > I couldn't figure out any nice way (it is possible with some more logic > inside the sed apparently) to do this is one command, so I had to use > all of the commands above. [...] > diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c > index 369c3df8a0..3985a92f02 100644 > --- a/hw/i386/xen/xen-mapcache.c > +++ b/hw/i386/xen/xen-mapcache.c > @@ -125,8 +125,8 @@ void xen_map_cache_init(phys_offset_to_gaddr_t f, void > *opaque) > rlimit_as.rlim_cur = rlimit_as.rlim_max; > > if (rlimit_as.rlim_max != RLIM_INFINITY) { > - fprintf(stderr, "Warning: QEMU's maximum size of virtual" > - " memory is not infinity.\n"); > + warn_report("QEMU's maximum size of virtual" > + " memory is not infinity."); > } > if (rlimit_as.rlim_max < MCACHE_MAX_SIZE + NON_MCACHE_MEMORY_SIZE) { > mapcache->max_mcache_size = rlimit_as.rlim_max -
warning: implicit declaration of function ‘warn_report’ [-Wimplicit-function-declaration] Please double-check for warnings. [...]