* [PATCH 0/3] RDS: Adjustments for two function implementations
@ 2017-05-22 14:10 SF Markus Elfring
2017-05-22 14:11 ` [PATCH 1/3] RDS: IB: Delete an error message for a failed memory allocation in rds_ib_add_one() SF Markus Elfring
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: SF Markus Elfring @ 2017-05-22 14:10 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
rds-devel-N0ozoZBvEnrZJqsBc5GL+g, David S. Miller,
Santosh Shilimkar, Sowmini Varadhan
Cc: LKML, kernel-janitors-u79uwXL29TY76Z2rM5mHXA
From: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Date: Mon, 22 May 2017 16:02:03 +0200
Three update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Delete an error message for a failed memory allocation in rds_ib_add_one()
Improve a size determination in rds_ib_add_one()
Delete an error message for a failed memory allocation in rds_tcp_init_net()
net/rds/ib.c | 7 ++-----
net/rds/tcp.c | 5 ++---
2 files changed, 4 insertions(+), 8 deletions(-)
--
2.13.0
--
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] 9+ messages in thread
* [PATCH 1/3] RDS: IB: Delete an error message for a failed memory allocation in rds_ib_add_one()
2017-05-22 14:10 [PATCH 0/3] RDS: Adjustments for two function implementations SF Markus Elfring
@ 2017-05-22 14:11 ` SF Markus Elfring
[not found] ` <e3491aaa-f471-c67c-43dc-41d592159c8e-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
[not found] ` <44b46c51-3665-5f14-dd3b-6e6f230258a7-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-05-22 14:13 ` [PATCH 3/3] RDS: TCP: Delete an error message for a failed memory allocation in rds_tcp_init_net() SF Markus Elfring
2 siblings, 1 reply; 9+ messages in thread
From: SF Markus Elfring @ 2017-05-22 14:11 UTC (permalink / raw)
To: linux-rdma, netdev, rds-devel, David S. Miller, Santosh Shilimkar,
Sowmini Varadhan
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 22 May 2017 15:34:28 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
net/rds/ib.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/net/rds/ib.c b/net/rds/ib.c
index 7a64c8db81ab..c5514d058171 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -166,8 +166,5 @@ static void rds_ib_add_one(struct ib_device *device)
- if (!rds_ibdev->vector_load) {
- pr_err("RDS/IB: %s failed to allocate vector memory\n",
- __func__);
+ if (!rds_ibdev->vector_load)
goto put_dev;
- }
rds_ibdev->dev = device;
rds_ibdev->pd = ib_alloc_pd(device, 0);
--
2.13.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
[parent not found: <44b46c51-3665-5f14-dd3b-6e6f230258a7-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>]
* [PATCH 2/3] RDS: IB: Improve a size determination in rds_ib_add_one()
[not found] ` <44b46c51-3665-5f14-dd3b-6e6f230258a7-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
@ 2017-05-22 14:12 ` SF Markus Elfring
[not found] ` <e8486283-62ac-ea77-1169-edca3e630637-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: SF Markus Elfring @ 2017-05-22 14:12 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
rds-devel-N0ozoZBvEnrZJqsBc5GL+g, David S. Miller,
Santosh Shilimkar, Sowmini Varadhan
Cc: LKML, kernel-janitors-u79uwXL29TY76Z2rM5mHXA
From: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Date: Mon, 22 May 2017 15:40:21 +0200
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
---
net/rds/ib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/rds/ib.c b/net/rds/ib.c
index c5514d058171..ed37bf011704 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -131,7 +131,7 @@ static void rds_ib_add_one(struct ib_device *device)
if (device->node_type != RDMA_NODE_IB_CA)
return;
- rds_ibdev = kzalloc_node(sizeof(struct rds_ib_device), GFP_KERNEL,
+ rds_ibdev = kzalloc_node(sizeof(*rds_ibdev), GFP_KERNEL,
ibdev_to_node(device));
if (!rds_ibdev)
return;
--
2.13.0
--
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] 9+ messages in thread
* [PATCH 3/3] RDS: TCP: Delete an error message for a failed memory allocation in rds_tcp_init_net()
2017-05-22 14:10 [PATCH 0/3] RDS: Adjustments for two function implementations SF Markus Elfring
2017-05-22 14:11 ` [PATCH 1/3] RDS: IB: Delete an error message for a failed memory allocation in rds_ib_add_one() SF Markus Elfring
[not found] ` <44b46c51-3665-5f14-dd3b-6e6f230258a7-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
@ 2017-05-22 14:13 ` SF Markus Elfring
[not found] ` <5d523cf8-1540-e704-2301-a5e0205cb536-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2 siblings, 1 reply; 9+ messages in thread
From: SF Markus Elfring @ 2017-05-22 14:13 UTC (permalink / raw)
To: linux-rdma, netdev, rds-devel, David S. Miller, Santosh Shilimkar,
Sowmini Varadhan
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 22 May 2017 15:45:31 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
net/rds/tcp.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index 431404dbdad1..b0348697dee5 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
@@ -431,10 +431,9 @@ static __net_init int rds_tcp_init_net(struct net *net)
} else {
tbl = kmemdup(rds_tcp_sysctl_table,
sizeof(rds_tcp_sysctl_table), GFP_KERNEL);
- if (!tbl) {
- pr_warn("could not set allocate syctl table\n");
+ if (!tbl)
return -ENOMEM;
- }
+
rtn->ctl_table = tbl;
}
tbl[RDS_TCP_SNDBUF].data = &rtn->sndbuf_size;
--
2.13.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-05-22 19:24 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 14:10 [PATCH 0/3] RDS: Adjustments for two function implementations SF Markus Elfring
2017-05-22 14:11 ` [PATCH 1/3] RDS: IB: Delete an error message for a failed memory allocation in rds_ib_add_one() SF Markus Elfring
[not found] ` <e3491aaa-f471-c67c-43dc-41d592159c8e-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-05-22 19:24 ` Santosh Shilimkar
[not found] ` <44b46c51-3665-5f14-dd3b-6e6f230258a7-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-05-22 14:12 ` [PATCH 2/3] RDS: IB: Improve a size determination " SF Markus Elfring
[not found] ` <e8486283-62ac-ea77-1169-edca3e630637-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-05-22 19:22 ` Santosh Shilimkar
2017-05-22 14:13 ` [PATCH 3/3] RDS: TCP: Delete an error message for a failed memory allocation in rds_tcp_init_net() SF Markus Elfring
[not found] ` <5d523cf8-1540-e704-2301-a5e0205cb536-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-05-22 14:26 ` Sowmini Varadhan
2017-05-22 14:32 ` SF Markus Elfring
2017-05-22 14:46 ` Sowmini Varadhan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).