src/lib: add IS_ENABLED() around Kconfig symbol references

Some of these can be changed from #if to if(), but that will happen
in a follow-on commmit.

Change-Id: Idcea3f8b1a4246cb6b29999a84a191a3133e5c78
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/20341
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Martin Roth
2017-06-24 14:16:38 -06:00
parent 5764cbbf91
commit 1bf55b4070
8 changed files with 39 additions and 39 deletions

View File

@ -41,7 +41,7 @@ static FILE *previous_file = NULL;
static FILE *fopen(const char *path, const char *mode)
{
#if CONFIG_DEBUG_COVERAGE
#if IS_ENABLED(CONFIG_DEBUG_COVERAGE)
printk(BIOS_DEBUG, "fopen %s with mode %s\n",
path, mode);
#endif
@ -74,7 +74,7 @@ static FILE *fopen(const char *path, const char *mode)
static int fclose(FILE *stream)
{
#if CONFIG_DEBUG_COVERAGE
#if IS_ENABLED(CONFIG_DEBUG_COVERAGE)
printk(BIOS_DEBUG, "fclose %s\n", stream->filename);
#endif
return 0;
@ -85,7 +85,7 @@ static int fseek(FILE *stream, long offset, int whence)
/* fseek should only be called with offset==0 and whence==SEEK_SET
* to a freshly opened file. */
gcc_assert(offset == 0 && whence == SEEK_SET);
#if CONFIG_DEBUG_COVERAGE
#if IS_ENABLED(CONFIG_DEBUG_COVERAGE)
printk(BIOS_DEBUG, "fseek %s offset=%ld whence=%d\n",
stream->filename, offset, whence);
#endif
@ -96,7 +96,7 @@ static long ftell(FILE *stream)
{
/* ftell should currently not be called */
gcc_assert(0);
#if CONFIG_DEBUG_COVERAGE
#if IS_ENABLED(CONFIG_DEBUG_COVERAGE)
printk(BIOS_DEBUG, "ftell %s\n", stream->filename);
#endif
return 0;
@ -104,7 +104,7 @@ static long ftell(FILE *stream)
static size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
{
#if CONFIG_DEBUG_COVERAGE
#if IS_ENABLED(CONFIG_DEBUG_COVERAGE)
printk(BIOS_DEBUG, "fread: ptr=%p size=%zd nmemb=%zd FILE*=%p\n",
ptr, size, nmemb, stream);
#endif
@ -113,7 +113,7 @@ static size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
static size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
{
#if CONFIG_DEBUG_COVERAGE
#if IS_ENABLED(CONFIG_DEBUG_COVERAGE)
printk(BIOS_DEBUG, "fwrite: %zd * %zd bytes to file %s\n",
nmemb, size, stream->filename);
#endif
@ -145,7 +145,7 @@ static void coverage_init(void *unused)
void __gcov_flush(void);
static void coverage_exit(void *unused)
{
#if CONFIG_DEBUG_COVERAGE
#if IS_ENABLED(CONFIG_DEBUG_COVERAGE)
printk(BIOS_DEBUG, "Syncing coverage data.\n");
#endif
__gcov_flush();