Commit 3a188bd0 authored by Federico Vaga's avatar Federico Vaga

sw:drv: apply coccicheck suggestions

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent d9843590
...@@ -82,16 +82,9 @@ static ssize_t spec_dbg_fw_write(struct file *file, ...@@ -82,16 +82,9 @@ static ssize_t spec_dbg_fw_write(struct file *file,
return count; return count;
} }
static int spec_dbg_fw_open(struct inode *inode, struct file *file)
{
file->private_data = inode->i_private;
return 0;
}
static const struct file_operations spec_dbg_fw_ops = { static const struct file_operations spec_dbg_fw_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = spec_dbg_fw_open, .open = simple_open,
.write = spec_dbg_fw_write, .write = spec_dbg_fw_write,
}; };
...@@ -279,12 +272,10 @@ static int spec_gpio_init_table(struct spec_gn412x *spec_gn412x) ...@@ -279,12 +272,10 @@ static int spec_gpio_init_table(struct spec_gn412x *spec_gn412x)
struct gpiod_lookup_table *lookup; struct gpiod_lookup_table *lookup;
int err = 0; int err = 0;
lookup = kzalloc(spec_gpiod_table_size(), GFP_KERNEL); lookup = kmemdup(&spec_gpiod_table, spec_gpiod_table_size(), GFP_KERNEL);
if (!lookup) if (!lookup)
return -ENOMEM; return -ENOMEM;
memcpy(lookup, &spec_gpiod_table, spec_gpiod_table_size());
lookup->dev_id = kstrdup(dev_name(&spec_gn412x->pdev->dev), GFP_KERNEL); lookup->dev_id = kstrdup(dev_name(&spec_gn412x->pdev->dev), GFP_KERNEL);
if (!lookup->dev_id) if (!lookup->dev_id)
goto err_dup; goto err_dup;
......
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