Remove trailing whitespace before \n in printf()

Tree-wide cleanup of all instances of printf()-style functions where a
format string contains a space before a newline character.

Change-Id: Ib5b5861e97bed9e9d62db03875547e3f771f4769
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/397031
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Daniel Verkamp 2018-01-29 16:43:37 -07:00 committed by Jim Harris
parent 46b93de613
commit 64465d0dc8
9 changed files with 35 additions and 22 deletions

View File

@ -405,7 +405,7 @@ show_bs_cb(void *arg1, spdk_blob_id blobid, int bserrno)
printf("\nBlobstore Private Info:\n");
printf("\tMetadata start (pages): %" PRIu64 "\n",
cli_context->bs->md_start);
printf("\tMetadata length (pages): %d \n",
printf("\tMetadata length (pages): %d\n",
cli_context->bs->md_len);
unload_bs(cli_context, "", 0);

View File

@ -426,7 +426,7 @@ dump_result(struct thread_entry *threads, uint32_t num_threads)
total_failed += t->xfer_failed;
total_failed += t->fill_failed;
if (t->xfer_completed || t->xfer_failed)
printf("lcore = %d, copy success = %ld, copy failed = %ld, fill success = %ld, fill failed = %ld \n",
printf("lcore = %d, copy success = %ld, copy failed = %ld, fill success = %ld, fill failed = %ld\n",
t->lcore_id, t->xfer_completed, t->xfer_failed, t->fill_completed, t->fill_failed);
}
return total_failed ? 1 : 0;

View File

@ -954,7 +954,7 @@ print_controller(struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_transport
printf("Wear Leveling Count:\n");
printf(" Normalized Value : %d\n",
intel_smart_page.attributes[i].normalized_value);
printf(" Current Raw Value: \n");
printf(" Current Raw Value:\n");
printf(" Min: ");
print_uint_var_dec(&intel_smart_page.attributes[i].raw_value[0], 2);
printf("\n");
@ -1010,7 +1010,7 @@ print_controller(struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_transport
printf("Thermal Throttle Status:\n");
printf(" Normalized Value : %d\n",
intel_smart_page.attributes[i].normalized_value);
printf(" Current Raw Value: \n");
printf(" Current Raw Value:\n");
printf(" Percentage: %d%%\n", intel_smart_page.attributes[i].raw_value[0]);
printf(" Throttling Event Count: ");
print_uint_var_dec(&intel_smart_page.attributes[i].raw_value[1], 4);

View File

@ -315,7 +315,7 @@ get_controller(void)
display_controller(iter, CONTROLLER_DISPLAY_SIMPLISTIC);
}
printf("Please Input PCI Address(domain:bus:dev.func): \n");
printf("Please Input PCI Address(domain:bus:dev.func):\n");
while ((ch = getchar()) != '\n' && ch != EOF);
p = get_line(address, 64, stdin);
@ -409,7 +409,7 @@ get_allocated_nsid(struct dev *dev)
spdk_dma_free(ns_list);
printf("Please Input Namespace ID: \n");
printf("Please Input Namespace ID:\n");
if (!scanf("%u", &nsid)) {
printf("Invalid Namespace ID\n");
nsid = 0;
@ -567,21 +567,21 @@ add_ns(void)
return;
}
printf("Please Input Namespace Size (in LBAs): \n");
printf("Please Input Namespace Size (in LBAs):\n");
if (!scanf("%" SCNi64, &ns_size)) {
printf("Invalid Namespace Size\n");
while (getchar() != '\n');
return;
}
printf("Please Input Namespace Capacity (in LBAs): \n");
printf("Please Input Namespace Capacity (in LBAs):\n");
if (!scanf("%" SCNi64, &ns_capacity)) {
printf("Invalid Namespace Capacity\n");
while (getchar() != '\n');
return;
}
printf("Please Input Data Protection Type (0 - 3): \n");
printf("Please Input Data Protection Type (0 - 3):\n");
if (!scanf("%d", &ns_dps_type)) {
printf("Invalid Data Protection Type\n");
while (getchar() != '\n');
@ -589,7 +589,7 @@ add_ns(void)
}
if (SPDK_NVME_FMT_NVM_PROTECTION_DISABLE != ns_dps_type) {
printf("Please Input Data Protection Location (1: Head; 0: Tail): \n");
printf("Please Input Data Protection Location (1: Head; 0: Tail):\n");
if (!scanf("%d", &ns_dps_location)) {
printf("Invalid Data Protection Location\n");
while (getchar() != '\n');
@ -597,7 +597,7 @@ add_ns(void)
}
}
printf("Please Input Multi-path IO and Sharing Capabilities (1: Share; 0: Private): \n");
printf("Please Input Multi-path IO and Sharing Capabilities (1: Share; 0: Private):\n");
if (!scanf("%d", &ns_nmic)) {
printf("Invalid Multi-path IO and Sharing Capabilities\n");
while (getchar() != '\n');
@ -625,7 +625,7 @@ delete_ns(void)
return;
}
printf("Please Input Namespace ID: \n");
printf("Please Input Namespace ID:\n");
if (!scanf("%d", &ns_id)) {
printf("Invalid Namespace ID\n");
while (getchar() != '\n');
@ -667,7 +667,7 @@ format_nvm(void)
ns_id = SPDK_NVME_GLOBAL_NS_TAG;
ns = spdk_nvme_ctrlr_get_ns(ctrlr->ctrlr, 1);
} else {
printf("Please Input Namespace ID (1 - %d): \n", cdata->nn);
printf("Please Input Namespace ID (1 - %d):\n", cdata->nn);
if (!scanf("%d", &ns_id)) {
printf("Invalid Namespace ID\n");
while (getchar() != '\n');
@ -684,7 +684,7 @@ format_nvm(void)
nsdata = spdk_nvme_ns_get_data(ns);
printf("Please Input Secure Erase Setting: \n");
printf("Please Input Secure Erase Setting:\n");
printf(" 0: No secure erase operation requested\n");
printf(" 1: User data erase\n");
if (cdata->fna.crypto_erase_supported) {
@ -703,7 +703,7 @@ format_nvm(void)
}
if (nsdata->lbaf[lbaf].ms) {
printf("Please Input Protection Information: \n");
printf("Please Input Protection Information:\n");
printf(" 0: Protection information is not enabled\n");
printf(" 1: Protection information is enabled, Type 1\n");
printf(" 2: Protection information is enabled, Type 2\n");
@ -715,7 +715,7 @@ format_nvm(void)
}
if (pi) {
printf("Please Input Protection Information Location: \n");
printf("Please Input Protection Information Location:\n");
printf(" 0: Protection information transferred as the last eight bytes of metadata\n");
printf(" 1: Protection information transferred as the first eight bytes of metadata\n");
if (!scanf("%d", &pil)) {
@ -727,7 +727,7 @@ format_nvm(void)
pil = 0;
}
printf("Please Input Metadata Setting: \n");
printf("Please Input Metadata Setting:\n");
printf(" 0: Metadata is transferred as part of a separate buffer\n");
printf(" 1: Metadata is transferred as part of an extended data LBA\n");
if (!scanf("%d", &ms)) {
@ -832,7 +832,7 @@ update_firmware_image(void)
}
close(fd);
printf("Please Input Slot(0 - 7): \n");
printf("Please Input Slot(0 - 7):\n");
if (!scanf("%d", &slot)) {
printf("Invalid Slot\n");
spdk_dma_free(fw_image);

View File

@ -469,7 +469,7 @@ bdev_malloc_get_spdk_running_config(FILE *fp)
"\n"
"# Users may change this section to create a different number or size of\n"
"# malloc LUNs.\n"
"# This will generate %d LUNs with a malloc-allocated backend. Each LUN \n"
"# This will generate %d LUNs with a malloc-allocated backend. Each LUN\n"
"# will be %" PRIu64 "MB in size and these will be named Malloc0 through Malloc%d.\n"
"# Not all LUNs defined here are necessarily used below.\n"
"[Malloc]\n"

View File

@ -258,7 +258,7 @@ virtio_scsi_dev_init(struct virtio_scsi_dev *svdev, uint16_t max_queues)
svdev->eventq_ios = spdk_dma_zmalloc(sizeof(*svdev->eventq_ios) * num_events,
0, NULL);
if (svdev->eventq_ios == NULL) {
SPDK_ERRLOG("cannot allocate memory for %"PRIu16" eventq buffers \n",
SPDK_ERRLOG("cannot allocate memory for %"PRIu16" eventq buffers\n",
num_events);
virtio_dev_release_queue(vdev, VIRTIO_SCSI_EVENTQ);
virtio_dev_release_queue(vdev, VIRTIO_SCSI_CONTROLQ);

View File

@ -805,7 +805,7 @@ spdk_vhost_scsi_dev_add_tgt(struct spdk_vhost_dev *vdev, unsigned scsi_tgt_num,
}
if (bdev_name == NULL) {
SPDK_ERRLOG("No lun name specified \n");
SPDK_ERRLOG("No lun name specified\n");
return -EINVAL;
}

View File

@ -51,6 +51,19 @@ else
fi
rm -f comment.log
echo -n "Checking trailing whitespace in output strings..."
git grep --line-number -e ' \\n"' -- '*.[ch]' > whitespace.log || true
if [ -s whitespace.log ]; then
echo " Incorrect trailing whitespace detected"
cat whitespace.log
rc=1
else
echo " OK"
fi
rm -f whitespace.log
echo -n "Checking for use of forbidden library functions..."
git grep -w strcpy -- app examples lib test > badfunc.log || true

View File

@ -591,7 +591,7 @@ function vm_setup()
[[ ! -e $raw_disk ]]; then
if [[ $raw_disk =~ /dev/.* ]]; then
error \
"ERROR: Virtio disk point to missing device ($raw_disk) - \n" \
"ERROR: Virtio disk point to missing device ($raw_disk) -\n" \
" this is probably not what you want."
return 1
fi