Skip to content

Commit 50f338c

Browse files
Ruan Jinjierleon
authored andcommitted
RDMA/mthca: Remove unnecessary NULL assignments
There are many pointers assigned first, which need not to be initialized, so remove the NULL assignments. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Link: https://lore.kernel.org/r/20230731065543.2285928-1-ruanjinjie@huawei.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent d43ea9c commit 50f338c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

drivers/infiniband/hw/mthca/mthca_provider.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
static int mthca_query_device(struct ib_device *ibdev, struct ib_device_attr *props,
5454
struct ib_udata *uhw)
5555
{
56-
struct ib_smp *in_mad = NULL;
57-
struct ib_smp *out_mad = NULL;
56+
struct ib_smp *in_mad;
57+
struct ib_smp *out_mad;
5858
int err = -ENOMEM;
5959
struct mthca_dev *mdev = to_mdev(ibdev);
6060

@@ -121,8 +121,8 @@ static int mthca_query_device(struct ib_device *ibdev, struct ib_device_attr *pr
121121
static int mthca_query_port(struct ib_device *ibdev,
122122
u32 port, struct ib_port_attr *props)
123123
{
124-
struct ib_smp *in_mad = NULL;
125-
struct ib_smp *out_mad = NULL;
124+
struct ib_smp *in_mad;
125+
struct ib_smp *out_mad;
126126
int err = -ENOMEM;
127127

128128
in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL);
@@ -217,8 +217,8 @@ static int mthca_modify_port(struct ib_device *ibdev,
217217
static int mthca_query_pkey(struct ib_device *ibdev,
218218
u32 port, u16 index, u16 *pkey)
219219
{
220-
struct ib_smp *in_mad = NULL;
221-
struct ib_smp *out_mad = NULL;
220+
struct ib_smp *in_mad;
221+
struct ib_smp *out_mad;
222222
int err = -ENOMEM;
223223

224224
in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL);
@@ -246,8 +246,8 @@ static int mthca_query_pkey(struct ib_device *ibdev,
246246
static int mthca_query_gid(struct ib_device *ibdev, u32 port,
247247
int index, union ib_gid *gid)
248248
{
249-
struct ib_smp *in_mad = NULL;
250-
struct ib_smp *out_mad = NULL;
249+
struct ib_smp *in_mad;
250+
struct ib_smp *out_mad;
251251
int err = -ENOMEM;
252252

253253
in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL);
@@ -989,8 +989,8 @@ static const struct attribute_group mthca_attr_group = {
989989

990990
static int mthca_init_node_data(struct mthca_dev *dev)
991991
{
992-
struct ib_smp *in_mad = NULL;
993-
struct ib_smp *out_mad = NULL;
992+
struct ib_smp *in_mad;
993+
struct ib_smp *out_mad;
994994
int err = -ENOMEM;
995995

996996
in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL);

0 commit comments

Comments
 (0)