Commit ced2c60f authored by Ashutosh Dixit's avatar Ashutosh Dixit Committed by Greg Kroah-Hartman

misc: mic: cleanups for "--strict" checkpatch.

These changes were mostly authored by Joe Perches <joe@perches.com>
@ https://lkml.org/lkml/2013/9/5/602Reported-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarAshutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: default avatarDasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
Signed-off-by: default avatarNikhil Rao <nikhil.rao@intel.com>
Signed-off-by: default avatarHarshavardhan R Kharche <harshavardhan.r.kharche@intel.com>
Signed-off-by: default avatarSudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4aa79961
...@@ -246,7 +246,7 @@ static int tun_alloc(struct mic_info *mic, char *dev) ...@@ -246,7 +246,7 @@ static int tun_alloc(struct mic_info *mic, char *dev)
if (*dev) if (*dev)
strncpy(ifr.ifr_name, dev, IFNAMSIZ); strncpy(ifr.ifr_name, dev, IFNAMSIZ);
err = ioctl(fd, TUNSETIFF, (void *) &ifr); err = ioctl(fd, TUNSETIFF, (void *)&ifr);
if (err < 0) { if (err < 0) {
mpsslog("%s %s %d TUNSETIFF failed %s\n", mpsslog("%s %s %d TUNSETIFF failed %s\n",
mic->name, __func__, __LINE__, strerror(errno)); mic->name, __func__, __LINE__, strerror(errno));
...@@ -587,7 +587,7 @@ virtio_net(void *arg) ...@@ -587,7 +587,7 @@ virtio_net(void *arg)
copy.iov, copy.iovcnt); copy.iov, copy.iovcnt);
if (len > 0) { if (len > 0) {
struct virtio_net_hdr *hdr struct virtio_net_hdr *hdr
= (struct virtio_net_hdr *) vnet_hdr[0]; = (struct virtio_net_hdr *)vnet_hdr[0];
/* Disable checksums on the card since we are on /* Disable checksums on the card since we are on
a reliable PCIe link */ a reliable PCIe link */
...@@ -1033,7 +1033,8 @@ start_virtblk(struct mic_info *mic, struct mic_vring *vring) ...@@ -1033,7 +1033,8 @@ start_virtblk(struct mic_info *mic, struct mic_vring *vring)
} }
add_virtio_device(mic, &virtblk_dev_page.dd); add_virtio_device(mic, &virtblk_dev_page.dd);
if (MAP_FAILED == init_vr(mic, mic->mic_virtblk.virtio_block_fd, if (MAP_FAILED == init_vr(mic, mic->mic_virtblk.virtio_block_fd,
VIRTIO_ID_BLOCK, vring, NULL, virtblk_dev_page.dd.num_vq)) { VIRTIO_ID_BLOCK, vring, NULL,
virtblk_dev_page.dd.num_vq)) {
mpsslog("%s init_vr failed %s\n", mpsslog("%s init_vr failed %s\n",
mic->name, strerror(errno)); mic->name, strerror(errno));
return false; return false;
...@@ -1132,7 +1133,7 @@ write_status(int fd, __u8 *status) ...@@ -1132,7 +1133,7 @@ write_status(int fd, __u8 *status)
static void * static void *
virtio_block(void *arg) virtio_block(void *arg)
{ {
struct mic_info *mic = (struct mic_info *) arg; struct mic_info *mic = (struct mic_info *)arg;
int ret; int ret;
struct pollfd block_poll; struct pollfd block_poll;
struct mic_vring vring; struct mic_vring vring;
...@@ -1219,8 +1220,8 @@ virtio_block(void *arg) ...@@ -1219,8 +1220,8 @@ virtio_block(void *arg)
status = 0; status = 0;
fos = mic->mic_virtblk.backend_addr + fos = mic->mic_virtblk.backend_addr +
(hdr.sector * SECTOR_SIZE); (hdr.sector * SECTOR_SIZE);
buffer_desc_idx = desc_idx = buffer_desc_idx = next_desc(desc);
next_desc(desc); desc_idx = buffer_desc_idx;
for (desc = &vring.vr.desc[buffer_desc_idx]; for (desc = &vring.vr.desc[buffer_desc_idx];
desc->flags & VRING_DESC_F_NEXT; desc->flags & VRING_DESC_F_NEXT;
desc_idx = next_desc(desc), desc_idx = next_desc(desc),
......
...@@ -167,7 +167,6 @@ struct mic_irq *mic_request_card_irq(irqreturn_t (*func)(int irq, void *data), ...@@ -167,7 +167,6 @@ struct mic_irq *mic_request_card_irq(irqreturn_t (*func)(int irq, void *data),
return (struct mic_irq *)cookie; return (struct mic_irq *)cookie;
err: err:
return ERR_PTR(rc); return ERR_PTR(rc);
} }
/** /**
......
...@@ -197,10 +197,9 @@ static void mic_notify(struct virtqueue *vq) ...@@ -197,10 +197,9 @@ static void mic_notify(struct virtqueue *vq)
static void mic_del_vq(struct virtqueue *vq, int n) static void mic_del_vq(struct virtqueue *vq, int n)
{ {
struct mic_vdev *mvdev = to_micvdev(vq->vdev); struct mic_vdev *mvdev = to_micvdev(vq->vdev);
struct vring *vr = (struct vring *) (vq + 1); struct vring *vr = (struct vring *)(vq + 1);
free_pages((unsigned long) vr->used, free_pages((unsigned long) vr->used, get_order(mvdev->used_size[n]));
get_order(mvdev->used_size[n]));
vring_del_virtqueue(vq); vring_del_virtqueue(vq);
mic_card_unmap(mvdev->mdev, mvdev->vr[n]); mic_card_unmap(mvdev->mdev, mvdev->vr[n]);
mvdev->vr[n] = NULL; mvdev->vr[n] = NULL;
...@@ -274,7 +273,7 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev, ...@@ -274,7 +273,7 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev,
/* Allocate and reassign used ring now */ /* Allocate and reassign used ring now */
mvdev->used_size[index] = PAGE_ALIGN(sizeof(__u16) * 3 + mvdev->used_size[index] = PAGE_ALIGN(sizeof(__u16) * 3 +
sizeof(struct vring_used_elem) * config.num); sizeof(struct vring_used_elem) * config.num);
used = (void *) __get_free_pages(GFP_KERNEL | __GFP_ZERO, used = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
get_order(mvdev->used_size[index])); get_order(mvdev->used_size[index]));
if (!used) { if (!used) {
err = -ENOMEM; err = -ENOMEM;
...@@ -291,7 +290,7 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev, ...@@ -291,7 +290,7 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev,
* vring_new_virtqueue() would ensure that * vring_new_virtqueue() would ensure that
* (&vq->vring == (struct vring *) (&vq->vq + 1)); * (&vq->vring == (struct vring *) (&vq->vq + 1));
*/ */
vr = (struct vring *) (vq + 1); vr = (struct vring *)(vq + 1);
vr->used = used; vr->used = used;
vq->priv = mvdev; vq->priv = mvdev;
......
...@@ -242,7 +242,7 @@ static int mic_dp_show(struct seq_file *s, void *pos) ...@@ -242,7 +242,7 @@ static int mic_dp_show(struct seq_file *s, void *pos)
vqconfig->used_address); vqconfig->used_address);
} }
features = (__u32 *) mic_vq_features(d); features = (__u32 *)mic_vq_features(d);
seq_printf(s, "Features: Host 0x%x ", features[0]); seq_printf(s, "Features: Host 0x%x ", features[0]);
seq_printf(s, "Guest 0x%x\n", features[1]); seq_printf(s, "Guest 0x%x\n", features[1]);
...@@ -321,8 +321,7 @@ static int mic_vdev_info_show(struct seq_file *s, void *unused) ...@@ -321,8 +321,7 @@ static int mic_vdev_info_show(struct seq_file *s, void *unused)
seq_printf(s, "desc[%d] addr 0x%llx len %d", seq_printf(s, "desc[%d] addr 0x%llx len %d",
j, desc->addr, desc->len); j, desc->addr, desc->len);
seq_printf(s, " flags 0x%x next %d\n", seq_printf(s, " flags 0x%x next %d\n",
desc->flags, desc->flags, desc->next);
desc->next);
desc++; desc++;
} }
avail = vrh->vring.avail; avail = vrh->vring.avail;
...@@ -340,7 +339,8 @@ static int mic_vdev_info_show(struct seq_file *s, void *unused) ...@@ -340,7 +339,8 @@ static int mic_vdev_info_show(struct seq_file *s, void *unused)
used->flags, used->idx); used->flags, used->idx);
for (j = 0; j < num; j++) for (j = 0; j < num; j++)
seq_printf(s, "used ring[%d] id %d len %d\n", seq_printf(s, "used ring[%d] id %d len %d\n",
j, used->ring[j].id, used->ring[j].len); j, used->ring[j].id,
used->ring[j].len);
} }
} }
mutex_unlock(&mdev->mic_mutex); mutex_unlock(&mdev->mic_mutex);
...@@ -400,8 +400,8 @@ static int mic_msi_irq_info_show(struct seq_file *s, void *pos) ...@@ -400,8 +400,8 @@ static int mic_msi_irq_info_show(struct seq_file *s, void *pos)
seq_printf(s, "%-10s", "count:"); seq_printf(s, "%-10s", "count:");
for (j = (MIC_NUM_OFFSETS - 1); j >= 0; j--) for (j = (MIC_NUM_OFFSETS - 1); j >= 0; j--)
seq_printf(s, "%4d ", seq_printf(s, "%4d ",
(mdev->irq_info.mic_msi_map[i] & BIT(j)) ? (mdev->irq_info.mic_msi_map[i] &
1 : 0); BIT(j)) ? 1 : 0);
seq_puts(s, "\n\n"); seq_puts(s, "\n\n");
} }
} else { } else {
...@@ -409,7 +409,6 @@ static int mic_msi_irq_info_show(struct seq_file *s, void *pos) ...@@ -409,7 +409,6 @@ static int mic_msi_irq_info_show(struct seq_file *s, void *pos)
} }
return 0; return 0;
} }
static int mic_msi_irq_info_debug_open(struct inode *inode, struct file *file) static int mic_msi_irq_info_debug_open(struct inode *inode, struct file *file)
...@@ -443,26 +442,23 @@ void mic_create_debug_dir(struct mic_device *mdev) ...@@ -443,26 +442,23 @@ void mic_create_debug_dir(struct mic_device *mdev)
if (!mdev->dbg_dir) if (!mdev->dbg_dir)
return; return;
debugfs_create_file("log_buf", 0444, mdev->dbg_dir, debugfs_create_file("log_buf", 0444, mdev->dbg_dir, mdev, &log_buf_ops);
mdev, &log_buf_ops);
debugfs_create_file("smpt", 0444, mdev->dbg_dir, debugfs_create_file("smpt", 0444, mdev->dbg_dir, mdev, &smpt_file_ops);
mdev, &smpt_file_ops);
debugfs_create_file("soft_reset", 0444, mdev->dbg_dir, debugfs_create_file("soft_reset", 0444, mdev->dbg_dir, mdev,
mdev, &soft_reset_ops); &soft_reset_ops);
debugfs_create_file("post_code", 0444, mdev->dbg_dir, debugfs_create_file("post_code", 0444, mdev->dbg_dir, mdev,
mdev, &post_code_ops); &post_code_ops);
debugfs_create_file("dp", 0444, mdev->dbg_dir, debugfs_create_file("dp", 0444, mdev->dbg_dir, mdev, &dp_ops);
mdev, &dp_ops);
debugfs_create_file("vdev_info", 0444, mdev->dbg_dir, debugfs_create_file("vdev_info", 0444, mdev->dbg_dir, mdev,
mdev, &vdev_info_ops); &vdev_info_ops);
debugfs_create_file("msi_irq_info", 0444, mdev->dbg_dir, debugfs_create_file("msi_irq_info", 0444, mdev->dbg_dir, mdev,
mdev, &msi_irq_info_ops); &msi_irq_info_ops);
} }
/** /**
......
...@@ -140,9 +140,9 @@ unsigned int mic_poll(struct file *f, poll_table *wait) ...@@ -140,9 +140,9 @@ unsigned int mic_poll(struct file *f, poll_table *wait)
poll_wait(f, &mvdev->waitq, wait); poll_wait(f, &mvdev->waitq, wait);
if (mic_vdev_inited(mvdev)) if (mic_vdev_inited(mvdev)) {
mask = POLLERR; mask = POLLERR;
else if (mvdev->poll_wake) { } else if (mvdev->poll_wake) {
mvdev->poll_wake = 0; mvdev->poll_wake = 0;
mask = POLLIN | POLLOUT; mask = POLLIN | POLLOUT;
} }
......
...@@ -71,8 +71,8 @@ static irqreturn_t mic_interrupt(int irq, void *dev) ...@@ -71,8 +71,8 @@ static irqreturn_t mic_interrupt(int irq, void *dev)
/* Return the interrupt offset from the index. Index is 0 based. */ /* Return the interrupt offset from the index. Index is 0 based. */
static u16 mic_map_src_to_offset(struct mic_device *mdev, static u16 mic_map_src_to_offset(struct mic_device *mdev,
int intr_src, enum mic_intr_type type) { int intr_src, enum mic_intr_type type)
{
if (type >= MIC_NUM_INTR_TYPES) if (type >= MIC_NUM_INTR_TYPES)
return MIC_NUM_OFFSETS; return MIC_NUM_OFFSETS;
if (intr_src >= mdev->intr_info->intr_len[type]) if (intr_src >= mdev->intr_info->intr_len[type])
...@@ -112,7 +112,7 @@ static struct mic_intr_cb *mic_register_intr_callback(struct mic_device *mdev, ...@@ -112,7 +112,7 @@ static struct mic_intr_cb *mic_register_intr_callback(struct mic_device *mdev,
struct mic_intr_cb *intr_cb; struct mic_intr_cb *intr_cb;
unsigned long flags; unsigned long flags;
int rc; int rc;
intr_cb = kmalloc(sizeof(struct mic_intr_cb), GFP_KERNEL); intr_cb = kmalloc(sizeof(*intr_cb), GFP_KERNEL);
if (!intr_cb) if (!intr_cb)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
...@@ -182,9 +182,10 @@ static u8 mic_unregister_intr_callback(struct mic_device *mdev, u32 idx) ...@@ -182,9 +182,10 @@ static u8 mic_unregister_intr_callback(struct mic_device *mdev, u32 idx)
static int mic_setup_msix(struct mic_device *mdev, struct pci_dev *pdev) static int mic_setup_msix(struct mic_device *mdev, struct pci_dev *pdev)
{ {
int rc, i; int rc, i;
int entry_size = sizeof(*mdev->irq_info.msix_entries);
mdev->irq_info.msix_entries = kmalloc(sizeof(struct msix_entry) * mdev->irq_info.msix_entries = kmalloc_array(MIC_MIN_MSIX,
MIC_MIN_MSIX, GFP_KERNEL); entry_size, GFP_KERNEL);
if (!mdev->irq_info.msix_entries) { if (!mdev->irq_info.msix_entries) {
rc = -ENOMEM; rc = -ENOMEM;
goto err_nomem1; goto err_nomem1;
...@@ -231,8 +232,9 @@ static int mic_setup_callbacks(struct mic_device *mdev) ...@@ -231,8 +232,9 @@ static int mic_setup_callbacks(struct mic_device *mdev)
{ {
int i; int i;
mdev->irq_info.cb_list = kmalloc(sizeof(struct list_head) * mdev->irq_info.cb_list = kmalloc_array(MIC_NUM_OFFSETS,
MIC_NUM_OFFSETS, GFP_KERNEL); sizeof(*mdev->irq_info.cb_list),
GFP_KERNEL);
if (!mdev->irq_info.cb_list) if (!mdev->irq_info.cb_list)
return -ENOMEM; return -ENOMEM;
......
...@@ -366,8 +366,8 @@ int mic_smpt_init(struct mic_device *mdev) ...@@ -366,8 +366,8 @@ int mic_smpt_init(struct mic_device *mdev)
smpt_info = mdev->smpt; smpt_info = mdev->smpt;
mdev->smpt_ops->init(mdev); mdev->smpt_ops->init(mdev);
smpt_info->entry = kmalloc(sizeof(struct mic_smpt) smpt_info->entry = kmalloc_array(smpt_info->info.num_reg,
* smpt_info->info.num_reg, GFP_KERNEL); sizeof(*smpt_info->entry), GFP_KERNEL);
if (!smpt_info->entry) { if (!smpt_info->entry) {
err = -ENOMEM; err = -ENOMEM;
goto free_smpt; goto free_smpt;
......
...@@ -225,8 +225,7 @@ static int _mic_virtio_copy(struct mic_vdev *mvdev, ...@@ -225,8 +225,7 @@ static int _mic_virtio_copy(struct mic_vdev *mvdev,
* Update the used ring if a descriptor was available and some data was * Update the used ring if a descriptor was available and some data was
* copied in/out and the user asked for a used ring update. * copied in/out and the user asked for a used ring update.
*/ */
if (*head != USHRT_MAX && copy->out_len && if (*head != USHRT_MAX && copy->out_len && copy->update_used) {
copy->update_used) {
u32 total = 0; u32 total = 0;
/* Determine the total data consumed */ /* Determine the total data consumed */
...@@ -367,7 +366,6 @@ void mic_bh_handler(struct work_struct *work) ...@@ -367,7 +366,6 @@ void mic_bh_handler(struct work_struct *work)
static irqreturn_t mic_virtio_intr_handler(int irq, void *data) static irqreturn_t mic_virtio_intr_handler(int irq, void *data)
{ {
struct mic_vdev *mvdev = data; struct mic_vdev *mvdev = data;
struct mic_device *mdev = mvdev->mdev; struct mic_device *mdev = mvdev->mdev;
...@@ -438,8 +436,8 @@ static int mic_copy_dp_entry(struct mic_vdev *mvdev, ...@@ -438,8 +436,8 @@ static int mic_copy_dp_entry(struct mic_vdev *mvdev,
return -EFAULT; return -EFAULT;
} }
if (mic_aligned_desc_size(&dd) > MIC_MAX_DESC_BLK_SIZE if (mic_aligned_desc_size(&dd) > MIC_MAX_DESC_BLK_SIZE ||
|| dd.num_vq > MIC_MAX_VRINGS) { dd.num_vq > MIC_MAX_VRINGS) {
dev_err(mic_dev(mvdev), "%s %d err %d\n", dev_err(mic_dev(mvdev), "%s %d err %d\n",
__func__, __LINE__, -EINVAL); __func__, __LINE__, -EINVAL);
return -EINVAL; return -EINVAL;
...@@ -503,7 +501,7 @@ static void mic_init_device_ctrl(struct mic_vdev *mvdev, ...@@ -503,7 +501,7 @@ static void mic_init_device_ctrl(struct mic_vdev *mvdev,
{ {
struct mic_device_ctrl *dc; struct mic_device_ctrl *dc;
dc = mvdev->dc = (void *)devpage + mic_aligned_desc_size(devpage); dc = (void *)devpage + mic_aligned_desc_size(devpage);
dc->config_change = 0; dc->config_change = 0;
dc->guest_ack = 0; dc->guest_ack = 0;
...@@ -512,6 +510,7 @@ static void mic_init_device_ctrl(struct mic_vdev *mvdev, ...@@ -512,6 +510,7 @@ static void mic_init_device_ctrl(struct mic_vdev *mvdev,
dc->used_address_updated = 0; dc->used_address_updated = 0;
dc->c2h_vdev_db = -1; dc->c2h_vdev_db = -1;
dc->h2c_vdev_db = -1; dc->h2c_vdev_db = -1;
mvdev->dc = dc;
} }
int mic_virtio_add_device(struct mic_vdev *mvdev, int mic_virtio_add_device(struct mic_vdev *mvdev,
...@@ -564,8 +563,7 @@ int mic_virtio_add_device(struct mic_vdev *mvdev, ...@@ -564,8 +563,7 @@ int mic_virtio_add_device(struct mic_vdev *mvdev,
vqconfig[i].address = mic_map_single(mdev, vqconfig[i].address = mic_map_single(mdev,
vr->va, vr_size); vr->va, vr_size);
if (mic_map_error(vqconfig[i].address)) { if (mic_map_error(vqconfig[i].address)) {
free_pages((unsigned long)vr->va, free_pages((unsigned long)vr->va, get_order(vr_size));
get_order(vr_size));
ret = -ENOMEM; ret = -ENOMEM;
dev_err(mic_dev(mvdev), "%s %d err %d\n", dev_err(mic_dev(mvdev), "%s %d err %d\n",
__func__, __LINE__, ret); __func__, __LINE__, ret);
...@@ -573,8 +571,7 @@ int mic_virtio_add_device(struct mic_vdev *mvdev, ...@@ -573,8 +571,7 @@ int mic_virtio_add_device(struct mic_vdev *mvdev,
} }
vqconfig[i].address = cpu_to_le64(vqconfig[i].address); vqconfig[i].address = cpu_to_le64(vqconfig[i].address);
vring_init(&vr->vr, num, vring_init(&vr->vr, num, vr->va, MIC_VIRTIO_RING_ALIGN);
vr->va, MIC_VIRTIO_RING_ALIGN);
ret = vringh_init_kern(&mvr->vrh, ret = vringh_init_kern(&mvr->vrh,
*(u32 *)mic_vq_features(mvdev->dd), num, false, *(u32 *)mic_vq_features(mvdev->dd), num, false,
vr->vr.desc, vr->vr.avail, vr->vr.used); vr->vr.desc, vr->vr.avail, vr->vr.used);
...@@ -593,8 +590,8 @@ int mic_virtio_add_device(struct mic_vdev *mvdev, ...@@ -593,8 +590,8 @@ int mic_virtio_add_device(struct mic_vdev *mvdev,
__func__, __LINE__, i, vr->va, vr->info, vr_size); __func__, __LINE__, i, vr->va, vr->info, vr_size);
} }
snprintf(irqname, sizeof(irqname), snprintf(irqname, sizeof(irqname), "mic%dvirtio%d", mdev->id,
"mic%dvirtio%d", mdev->id, mvdev->virtio_id); mvdev->virtio_id);
mvdev->virtio_db = mic_next_db(mdev); mvdev->virtio_db = mic_next_db(mdev);
mvdev->virtio_cookie = mic_request_irq(mdev, mic_virtio_intr_handler, mvdev->virtio_cookie = mic_request_irq(mdev, mic_virtio_intr_handler,
irqname, mvdev, mvdev->virtio_db, MIC_INTR_DB); irqname, mvdev, mvdev->virtio_db, MIC_INTR_DB);
......
...@@ -130,8 +130,8 @@ static void mic_x100_send_sbox_intr(struct mic_device *mdev, ...@@ -130,8 +130,8 @@ static void mic_x100_send_sbox_intr(struct mic_device *mdev,
{ {
struct mic_mw *mw = &mdev->mmio; struct mic_mw *mw = &mdev->mmio;
u64 apic_icr_offset = MIC_X100_SBOX_APICICR0 + doorbell * 8; u64 apic_icr_offset = MIC_X100_SBOX_APICICR0 + doorbell * 8;
u32 apicicr_low = mic_mmio_read(mw, u32 apicicr_low = mic_mmio_read(mw, MIC_X100_SBOX_BASE_ADDRESS +
MIC_X100_SBOX_BASE_ADDRESS + apic_icr_offset); apic_icr_offset);
/* for MIC we need to make sure we "hit" the send_icr bit (13) */ /* for MIC we need to make sure we "hit" the send_icr bit (13) */
apicicr_low = (apicicr_low | (1 << 13)); apicicr_low = (apicicr_low | (1 << 13));
...@@ -212,7 +212,7 @@ static u32 mic_x100_ack_interrupt(struct mic_device *mdev) ...@@ -212,7 +212,7 @@ static u32 mic_x100_ack_interrupt(struct mic_device *mdev)
*/ */
static void mic_x100_hw_intr_init(struct mic_device *mdev) static void mic_x100_hw_intr_init(struct mic_device *mdev)
{ {
mdev->intr_info = (struct mic_intr_info *) mic_x100_intr_init; mdev->intr_info = (struct mic_intr_info *)mic_x100_intr_init;
} }
/** /**
...@@ -365,8 +365,7 @@ mic_x100_load_command_line(struct mic_device *mdev, const struct firmware *fw) ...@@ -365,8 +365,7 @@ mic_x100_load_command_line(struct mic_device *mdev, const struct firmware *fw)
len += snprintf(buf, CMDLINE_SIZE - len, len += snprintf(buf, CMDLINE_SIZE - len,
" mem=%dM", boot_mem); " mem=%dM", boot_mem);
if (mdev->cmdline) if (mdev->cmdline)
snprintf(buf + len, CMDLINE_SIZE - len, snprintf(buf + len, CMDLINE_SIZE - len, " %s", mdev->cmdline);
" %s", mdev->cmdline);
memcpy_toio(cmd_line_va, buf, strlen(buf) + 1); memcpy_toio(cmd_line_va, buf, strlen(buf) + 1);
kfree(buf); kfree(buf);
return 0; return 0;
...@@ -397,8 +396,7 @@ mic_x100_load_ramdisk(struct mic_device *mdev) ...@@ -397,8 +396,7 @@ mic_x100_load_ramdisk(struct mic_device *mdev)
* Typically the bootaddr for card OS is 64M * Typically the bootaddr for card OS is 64M
* so copy over the ramdisk @ 128M. * so copy over the ramdisk @ 128M.
*/ */
memcpy_toio(mdev->aper.va + (mdev->bootaddr << 1), memcpy_toio(mdev->aper.va + (mdev->bootaddr << 1), fw->data, fw->size);
fw->data, fw->size);
iowrite32(cpu_to_le32(mdev->bootaddr << 1), &bp->hdr.ramdisk_image); iowrite32(cpu_to_le32(mdev->bootaddr << 1), &bp->hdr.ramdisk_image);
iowrite32(cpu_to_le32(fw->size), &bp->hdr.ramdisk_size); iowrite32(cpu_to_le32(fw->size), &bp->hdr.ramdisk_size);
release_firmware(fw); release_firmware(fw);
...@@ -484,8 +482,7 @@ mic_x100_load_firmware(struct mic_device *mdev, const char *buf) ...@@ -484,8 +482,7 @@ mic_x100_load_firmware(struct mic_device *mdev, const char *buf)
if (mdev->ramdisk) if (mdev->ramdisk)
rc = mic_x100_load_ramdisk(mdev); rc = mic_x100_load_ramdisk(mdev);
error: error:
dev_dbg(mdev->sdev->parent, "%s %d rc %d\n", dev_dbg(mdev->sdev->parent, "%s %d rc %d\n", __func__, __LINE__, rc);
__func__, __LINE__, rc);
done: done:
return rc; return rc;
} }
......
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