Do not rely on prio_to_str() being always inline
authorLucas De Marchi <lucas.demarchi@intel.com>
Thu, 9 Oct 2014 03:01:45 +0000 (00:01 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Thu, 9 Oct 2014 04:26:39 +0000 (01:26 -0300)
commit66bf1a7ff94829d152f146180962bfb079d4561e
treec3273a4b21da5bb226cf91b2e62b351fa380b93e
parentb95506ff6141aa65a46eef80fa0f0b06f9896712
Do not rely on prio_to_str() being always inline

This function was declared as always-inline so there was not really a
problem in returning prioname, that could possibly point to the local
buf[] variable.

However static analysis tools are often confused about this and being
always-inline was just a workaround to make it work.

So, let's move the buffer to the caller. We have only 2 callers so it
doesn't matter much. This always reduce the size of log.o, since now the
function is not inlined anymore. Below is the size for "-g -O2" with
gcc:

before:
   text    data     bss     dec     hex filename
   1325       4       1    1330     532 tools/log.o

after:
   text    data     bss     dec     hex filename
   1171       4       1    1176     498 tools/log.o
tools/log.c