misc: mic: cleanups for "--strict" checkpatch.
These changes were mostly authored by Joe Perches <joe@perches.com>
@ https://lkml.org/lkml/2013/9/5/602
Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Signed-off-by: Harshavardhan R Kharche <harshavardhan.r.kharche@intel.com>
Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/drivers/misc/mic/host/mic_smpt.c b/drivers/misc/mic/host/mic_smpt.c
index 003d02b..fae474c 100644
--- a/drivers/misc/mic/host/mic_smpt.c
+++ b/drivers/misc/mic/host/mic_smpt.c
@@ -84,7 +84,7 @@
for (i = spt; i < spt + entries; i++,
addr += smpt_info->info.page_size) {
if (!smpt_info->entry[i].ref_count &&
- (smpt_info->entry[i].dma_addr != addr)) {
+ (smpt_info->entry[i].dma_addr != addr)) {
mdev->smpt_ops->set(mdev, addr, i);
smpt_info->entry[i].dma_addr = addr;
}
@@ -183,7 +183,7 @@
if (!mic_is_system_addr(mdev, mic_addr)) {
dev_err(mdev->sdev->parent,
- "mic_addr is invalid. mic_addr = 0x%llx\n", mic_addr);
+ "mic_addr is invalid. mic_addr = 0x%llx\n", mic_addr);
return -EINVAL;
}
spt = mic_sys_addr_to_smpt(mdev, mic_addr);
@@ -286,7 +286,7 @@
smpt_info->entry[i].ref_count -= ref[i - spt];
if (smpt_info->entry[i].ref_count < 0)
dev_warn(mdev->sdev->parent,
- "ref count for entry %d is negative\n", i);
+ "ref count for entry %d is negative\n", i);
}
spin_unlock_irqrestore(&smpt_info->smpt_lock, flags);
kfree(ref);
@@ -320,7 +320,7 @@
"mic_map failed dma_addr 0x%llx size 0x%lx\n",
dma_addr, size);
pci_unmap_single(pdev, dma_addr,
- size, PCI_DMA_BIDIRECTIONAL);
+ size, PCI_DMA_BIDIRECTIONAL);
}
}
return mic_addr;
@@ -366,8 +366,8 @@
smpt_info = mdev->smpt;
mdev->smpt_ops->init(mdev);
- smpt_info->entry = kmalloc(sizeof(struct mic_smpt)
- * smpt_info->info.num_reg, GFP_KERNEL);
+ smpt_info->entry = kmalloc_array(smpt_info->info.num_reg,
+ sizeof(*smpt_info->entry), GFP_KERNEL);
if (!smpt_info->entry) {
err = -ENOMEM;
goto free_smpt;
@@ -412,7 +412,7 @@
smpt_info->entry[i].ref_count);
if (smpt_info->entry[i].ref_count)
dev_warn(mdev->sdev->parent,
- "ref count for entry %d is not zero\n", i);
+ "ref count for entry %d is not zero\n", i);
}
kfree(smpt_info->entry);
kfree(smpt_info);