* [PATCH 0/2] Fixes to issues in mlx5 code found by static checker
@ 2013-07-08 12:30 Or Gerlitz
[not found] ` <1373286607-3110-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Or Gerlitz @ 2013-07-08 12:30 UTC (permalink / raw)
To: roland-DgEjT+Ai2ygdnm+yROfE0A
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, moshel-VPRAkNaXOzVWk0Htik3J/w,
fengguang.wu-ral2JQCrhuEAvxtiuMwx3w, Or Gerlitz
All Reported-by Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Or Gerlitz (2):
mlx5: Use simple_open when possible
IB/mlx5: Removes unneeded semicolons
drivers/infiniband/hw/mlx5/mr.c | 15 ++++-----------
drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 13 +++----------
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c | 15 ++-------------
3 files changed, 9 insertions(+), 34 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] mlx5: Use simple_open when possible
[not found] ` <1373286607-3110-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2013-07-08 12:30 ` Or Gerlitz
[not found] ` <1373286607-3110-2-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-07-08 12:30 ` [PATCH 2/2] IB/mlx5: Removes unneeded semicolons Or Gerlitz
1 sibling, 1 reply; 5+ messages in thread
From: Or Gerlitz @ 2013-07-08 12:30 UTC (permalink / raw)
To: roland-DgEjT+Ai2ygdnm+yROfE0A
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, moshel-VPRAkNaXOzVWk0Htik3J/w,
fengguang.wu-ral2JQCrhuEAvxtiuMwx3w, Or Gerlitz
If the open entry for char-device just does
file->private_data = inode->i_private;
we can use simple_open instead.
Generated by: coccinelle/api/simple_open.cocci
Reported-by: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/hw/mlx5/mr.c | 11 ++---------
drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 13 +++----------
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c | 15 ++-------------
3 files changed, 7 insertions(+), 32 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 6b76150..6b41c94 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -49,13 +49,6 @@ static __be64 *mr_align(__be64 *ptr, int align)
return (__be64 *)(((unsigned long)ptr + mask) & ~mask);
}
-static int file_open(struct inode *inode, struct file *file)
-{
- file->private_data = inode->i_private;
-
- return 0;
-}
-
static int order2idx(struct mlx5_ib_dev *dev, int order)
{
struct mlx5_mr_cache *cache = &dev->cache;
@@ -224,7 +217,7 @@ static ssize_t size_read(struct file *filp, char __user *buf, size_t count,
static const struct file_operations size_fops = {
.owner = THIS_MODULE,
- .open = file_open,
+ .open = simple_open,
.write = size_write,
.read = size_read,
};
@@ -286,7 +279,7 @@ static ssize_t limit_read(struct file *filp, char __user *buf, size_t count,
static const struct file_operations limit_fops = {
.owner = THIS_MODULE,
- .open = file_open,
+ .open = simple_open,
.write = limit_write,
.read = limit_read,
};
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
index a0c8941..6e9628b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
@@ -95,13 +95,6 @@ enum {
MLX5_CMD_STAT_BAD_SIZE_OUTS_CQES_ERR = 0x40,
};
-static int dbg_open(struct inode *inode, struct file *file)
-{
- file->private_data = inode->i_private;
-
- return 0;
-}
-
static struct mlx5_cmd_work_ent *alloc_cmd(struct mlx5_cmd *cmd,
struct mlx5_cmd_msg *in,
struct mlx5_cmd_msg *out,
@@ -715,7 +708,7 @@ static ssize_t dbg_write(struct file *filp, const char __user *buf,
static const struct file_operations fops = {
.owner = THIS_MODULE,
- .open = dbg_open,
+ .open = simple_open,
.write = dbg_write,
};
@@ -935,7 +928,7 @@ static ssize_t data_read(struct file *filp, char __user *buf, size_t count,
static const struct file_operations dfops = {
.owner = THIS_MODULE,
- .open = dbg_open,
+ .open = simple_open,
.write = data_write,
.read = data_read,
};
@@ -1003,7 +996,7 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf,
static const struct file_operations olfops = {
.owner = THIS_MODULE,
- .open = dbg_open,
+ .open = simple_open,
.write = outlen_write,
.read = outlen_read,
};
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c
index 8acb754..106085b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c
@@ -142,17 +142,6 @@ void mlx5_eq_debugfs_cleanup(struct mlx5_core_dev *dev)
debugfs_remove_recursive(dev->priv.eq_debugfs);
}
-static int dbg_open(struct inode *inode, struct file *file)
-{
- /*
- * inode.i_private is equal to the data argument passed to
- * debugfs_create_file
- */
- file->private_data = inode->i_private;
-
- return 0;
-}
-
static ssize_t average_read(struct file *filp, char __user *buf, size_t count,
loff_t *pos)
{
@@ -200,7 +189,7 @@ static ssize_t average_write(struct file *filp, const char __user *buf,
static const struct file_operations stats_fops = {
.owner = THIS_MODULE,
- .open = dbg_open,
+ .open = simple_open,
.read = average_read,
.write = average_write,
};
@@ -467,7 +456,7 @@ static ssize_t dbg_read(struct file *filp, char __user *buf, size_t count,
static const struct file_operations fops = {
.owner = THIS_MODULE,
- .open = dbg_open,
+ .open = simple_open,
.read = dbg_read,
};
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] IB/mlx5: Removes unneeded semicolons
[not found] ` <1373286607-3110-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-07-08 12:30 ` [PATCH 1/2] mlx5: Use simple_open when possible Or Gerlitz
@ 2013-07-08 12:30 ` Or Gerlitz
1 sibling, 0 replies; 5+ messages in thread
From: Or Gerlitz @ 2013-07-08 12:30 UTC (permalink / raw)
To: roland-DgEjT+Ai2ygdnm+yROfE0A
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, moshel-VPRAkNaXOzVWk0Htik3J/w,
fengguang.wu-ral2JQCrhuEAvxtiuMwx3w, Or Gerlitz
Found by coccinelle
Generated by: coccinelle/misc/semicolon.cocci
Reported-by: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/hw/mlx5/mr.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 6b41c94..a03999c 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -157,7 +157,7 @@ static void remove_keys(struct mlx5_ib_dev *dev, int c, int num)
kfree(mr->pas);
kfree(mr);
}
- };
+ }
}
static ssize_t size_write(struct file *filp, const char __user *buf,
@@ -435,7 +435,7 @@ static void clean_keys(struct mlx5_ib_dev *dev, int c)
kfree(mr->pas);
kfree(mr);
}
- };
+ }
}
static int mlx5_mr_cache_debugfs_init(struct mlx5_ib_dev *dev)
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] mlx5: Use simple_open when possible
[not found] ` <1373286607-3110-2-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2013-07-08 12:34 ` Fengguang Wu
2013-07-08 12:57 ` Or Gerlitz
0 siblings, 1 reply; 5+ messages in thread
From: Fengguang Wu @ 2013-07-08 12:34 UTC (permalink / raw)
To: Or Gerlitz
Cc: roland-DgEjT+Ai2ygdnm+yROfE0A, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
moshel-VPRAkNaXOzVWk0Htik3J/w
Hi Or,
> static const struct file_operations limit_fops = {
> .owner = THIS_MODULE,
> - .open = file_open,
> + .open = simple_open,
> .write = limit_write,
> .read = limit_read,
> static const struct file_operations dfops = {
> .owner = THIS_MODULE,
> - .open = dbg_open,
> + .open = simple_open,
> .write = data_write,
> .read = data_read,
> };
> @@ -1003,7 +996,7 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf,
>
> static const struct file_operations olfops = {
> .owner = THIS_MODULE,
> - .open = dbg_open,
> + .open = simple_open,
> .write = outlen_write,
> .read = outlen_read,
> static const struct file_operations fops = {
> .owner = THIS_MODULE,
> - .open = dbg_open,
> + .open = simple_open,
> .read = dbg_read,
> };
The above chunks will need to fix alignments.
Thanks,
Fengguang
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] mlx5: Use simple_open when possible
2013-07-08 12:34 ` Fengguang Wu
@ 2013-07-08 12:57 ` Or Gerlitz
0 siblings, 0 replies; 5+ messages in thread
From: Or Gerlitz @ 2013-07-08 12:57 UTC (permalink / raw)
To: Fengguang Wu
Cc: roland-DgEjT+Ai2ygdnm+yROfE0A, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
moshel-VPRAkNaXOzVWk0Htik3J/w
On 08/07/2013 15:34, Fengguang Wu wrote:
> The above chunks will need to fix alignments.
sure
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-07-08 12:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-08 12:30 [PATCH 0/2] Fixes to issues in mlx5 code found by static checker Or Gerlitz
[not found] ` <1373286607-3110-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-07-08 12:30 ` [PATCH 1/2] mlx5: Use simple_open when possible Or Gerlitz
[not found] ` <1373286607-3110-2-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-07-08 12:34 ` Fengguang Wu
2013-07-08 12:57 ` Or Gerlitz
2013-07-08 12:30 ` [PATCH 2/2] IB/mlx5: Removes unneeded semicolons Or Gerlitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox