remove trailing whitespaces
[dpdk.git] / lib / librte_ivshmem / rte_ivshmem.c
index d62d016..b3a0b36 100644 (file)
@@ -1,13 +1,13 @@
 /*-
  *   BSD LICENSE
- * 
+ *
  *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
  *   All rights reserved.
- * 
+ *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
  *   are met:
- * 
+ *
  *     * Redistributions of source code must retain the above copyright
  *       notice, this list of conditions and the following disclaimer.
  *     * Redistributions in binary form must reproduce the above copyright
@@ -17,7 +17,7 @@
  *     * Neither the name of Intel Corporation nor the names of its
  *       contributors may be used to endorse or promote products derived
  *       from this software without specific prior written permission.
- * 
+ *
  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -35,6 +35,7 @@
 #include <unistd.h>
 #include <sys/mman.h>
 #include <string.h>
+#include <stdio.h>
 
 #include <rte_eal_memconfig.h>
 #include <rte_memory.h>
@@ -821,9 +822,8 @@ rte_ivshmem_metadata_cmdline_generate(char *buffer, unsigned size, const char *n
        return 0;
 }
 
-
 void
-rte_ivshmem_metadata_dump(const char *name)
+rte_ivshmem_metadata_dump(FILE *f, const char *name)
 {
        unsigned i = 0;
        struct ivshmem_config * config;
@@ -850,7 +850,7 @@ rte_ivshmem_metadata_dump(const char *name)
 
        while (entry->mz.addr != NULL && i < RTE_DIM(config->metadata->entry)) {
 
-               printf("Entry %u: name:<%-20s>, phys:0x%-15lx, len:0x%-15lx, "
+               fprintf(f, "Entry %u: name:<%-20s>, phys:0x%-15lx, len:0x%-15lx, "
                        "virt:%-15p, off:0x%-15lx\n",
                        i,
                        entry->mz.name,
@@ -861,7 +861,7 @@ rte_ivshmem_metadata_dump(const char *name)
                i++;
 
 #ifdef RTE_LIBRTE_IVSHMEM_DEBUG
-               printf("\tHugepage files:\n");
+               fprintf(f, "\tHugepage files:\n");
 
                hugepage_sz = entry->mz.hugepage_sz;
                addr = RTE_ALIGN_FLOOR(entry->mz.addr_64, hugepage_sz);
@@ -873,7 +873,7 @@ rte_ivshmem_metadata_dump(const char *name)
 
                        get_hugefile_by_virt_addr(addr, &e);
 
-                       printf("\t0x%"PRIx64 "-0x%" PRIx64 " offset: 0x%" PRIx64 " %s\n",
+                       fprintf(f, "\t0x%"PRIx64 "-0x%" PRIx64 " offset: 0x%" PRIx64 " %s\n",
                                        addr, addr + hugepage_sz, e.offset, e.filepath);
                }
 #endif