Commit 1e6b55ee authored by Sony Chacko's avatar Sony Chacko Committed by David S. Miller

qlcnic: fix coding style issues in qlcnic_minidump.c

Fix coding style violations in qlcnic_minidump.c
Signed-off-by: default avatarSony Chacko <sony.chacko@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58634e74
...@@ -115,7 +115,7 @@ struct qlcnic_dump_entry { ...@@ -115,7 +115,7 @@ struct qlcnic_dump_entry {
} region; } region;
} __packed; } __packed;
enum op_codes { enum qlcnic_minidump_opcode {
QLCNIC_DUMP_NOP = 0, QLCNIC_DUMP_NOP = 0,
QLCNIC_DUMP_READ_CRB = 1, QLCNIC_DUMP_READ_CRB = 1,
QLCNIC_DUMP_READ_MUX = 2, QLCNIC_DUMP_READ_MUX = 2,
...@@ -139,7 +139,7 @@ enum op_codes { ...@@ -139,7 +139,7 @@ enum op_codes {
}; };
struct qlcnic_dump_operations { struct qlcnic_dump_operations {
enum op_codes opcode; enum qlcnic_minidump_opcode opcode;
u32 (*handler)(struct qlcnic_adapter *, struct qlcnic_dump_entry *, u32 (*handler)(struct qlcnic_adapter *, struct qlcnic_dump_entry *,
__le32 *); __le32 *);
}; };
...@@ -269,7 +269,7 @@ static u32 qlcnic_dump_ctrl(struct qlcnic_adapter *adapter, ...@@ -269,7 +269,7 @@ static u32 qlcnic_dump_ctrl(struct qlcnic_adapter *adapter,
break; break;
default: default:
dev_info(&adapter->pdev->dev, dev_info(&adapter->pdev->dev,
"Unknown opcode\n"); "Unknown opcode\n");
break; break;
} }
} }
...@@ -455,8 +455,8 @@ static u32 qlcnic_read_memory(struct qlcnic_adapter *adapter, ...@@ -455,8 +455,8 @@ static u32 qlcnic_read_memory(struct qlcnic_adapter *adapter,
/* check for data size of multiple of 16 and 16 byte alignment */ /* check for data size of multiple of 16 and 16 byte alignment */
if ((addr & 0xf) || (reg_read%16)) { if ((addr & 0xf) || (reg_read%16)) {
dev_info(&adapter->pdev->dev, dev_info(&adapter->pdev->dev,
"Unaligned memory addr:0x%x size:0x%x\n", "Unaligned memory addr:0x%x size:0x%x\n",
addr, reg_read); addr, reg_read);
return -EINVAL; return -EINVAL;
} }
...@@ -528,12 +528,12 @@ static const struct qlcnic_dump_operations fw_dump_ops[] = { ...@@ -528,12 +528,12 @@ static const struct qlcnic_dump_operations fw_dump_ops[] = {
/* Walk the template and collect dump for each entry in the dump template */ /* Walk the template and collect dump for each entry in the dump template */
static int static int
qlcnic_valid_dump_entry(struct device *dev, struct qlcnic_dump_entry *entry, qlcnic_valid_dump_entry(struct device *dev, struct qlcnic_dump_entry *entry,
u32 size) u32 size)
{ {
int ret = 1; int ret = 1;
if (size != entry->hdr.cap_size) { if (size != entry->hdr.cap_size) {
dev_info(dev, dev_info(dev,
"Invalidate dump, Type:%d\tMask:%d\tSize:%dCap_size:%d\n", "Invalid dump, Type:%d\tMask:%d\tSize:%dCap_size:%d\n",
entry->hdr.type, entry->hdr.mask, size, entry->hdr.cap_size); entry->hdr.type, entry->hdr.mask, size, entry->hdr.cap_size);
dev_info(dev, "Aborting further dump capture\n"); dev_info(dev, "Aborting further dump capture\n");
ret = 0; ret = 0;
...@@ -554,7 +554,7 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter) ...@@ -554,7 +554,7 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter)
if (fw_dump->clr) { if (fw_dump->clr) {
dev_info(&adapter->pdev->dev, dev_info(&adapter->pdev->dev,
"Previous dump not cleared, not capturing dump\n"); "Previous dump not cleared, not capturing dump\n");
return -EIO; return -EIO;
} }
/* Calculate the size for dump data area only */ /* Calculate the size for dump data area only */
...@@ -567,8 +567,8 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter) ...@@ -567,8 +567,8 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter)
fw_dump->data = vzalloc(dump_size); fw_dump->data = vzalloc(dump_size);
if (!fw_dump->data) { if (!fw_dump->data) {
dev_info(&adapter->pdev->dev, dev_info(&adapter->pdev->dev,
"Unable to allocate (%d KB) for fw dump\n", "Unable to allocate (%d KB) for fw dump\n",
dump_size/1024); dump_size / 1024);
return -ENOMEM; return -ENOMEM;
} }
buffer = fw_dump->data; buffer = fw_dump->data;
...@@ -595,14 +595,14 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter) ...@@ -595,14 +595,14 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter)
} }
if (ops_index == ops_cnt) { if (ops_index == ops_cnt) {
dev_info(&adapter->pdev->dev, dev_info(&adapter->pdev->dev,
"Invalid entry type %d, exiting dump\n", "Invalid entry type %d, exiting dump\n",
entry->hdr.type); entry->hdr.type);
goto error; goto error;
} }
/* Collect dump for this entry */ /* Collect dump for this entry */
dump = fw_dump_ops[ops_index].handler(adapter, entry, buffer); dump = fw_dump_ops[ops_index].handler(adapter, entry, buffer);
if (dump && !qlcnic_valid_dump_entry(&adapter->pdev->dev, entry, if (dump && !qlcnic_valid_dump_entry(&adapter->pdev->dev, entry,
dump)) dump))
entry->hdr.flags |= QLCNIC_DUMP_SKIP; entry->hdr.flags |= QLCNIC_DUMP_SKIP;
buf_offset += entry->hdr.cap_size; buf_offset += entry->hdr.cap_size;
entry_offset += entry->hdr.offset; entry_offset += entry->hdr.offset;
...@@ -610,15 +610,15 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter) ...@@ -610,15 +610,15 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter)
} }
if (dump_size != buf_offset) { if (dump_size != buf_offset) {
dev_info(&adapter->pdev->dev, dev_info(&adapter->pdev->dev,
"Captured(%d) and expected size(%d) do not match\n", "Captured(%d) and expected size(%d) do not match\n",
buf_offset, dump_size); buf_offset, dump_size);
goto error; goto error;
} else { } else {
fw_dump->clr = 1; fw_dump->clr = 1;
snprintf(mesg, sizeof(mesg), "FW_DUMP=%s", snprintf(mesg, sizeof(mesg), "FW_DUMP=%s",
adapter->netdev->name); adapter->netdev->name);
dev_info(&adapter->pdev->dev, "Dump data, %d bytes captured\n", dev_info(&adapter->pdev->dev, "Dump data, %d bytes captured\n",
fw_dump->size); fw_dump->size);
/* Send a udev event to notify availability of FW dump */ /* Send a udev event to notify availability of FW dump */
kobject_uevent_env(&adapter->pdev->dev.kobj, KOBJ_CHANGE, msg); kobject_uevent_env(&adapter->pdev->dev.kobj, KOBJ_CHANGE, msg);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment