Re: [PATCH rdma-next 5/5] IB: Query port through the core instead of directly calling the driver handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 19, 2017 at 06:06:04AM +0000, Parav Pandit wrote:
> Minor nit for safer code.
>
> > -----Original Message-----
>
> > diff --git a/drivers/infiniband/hw/mlx4/alias_GUID.c
> > b/drivers/infiniband/hw/mlx4/alias_GUID.c
> > index 06020c5..4648374 100644
> > --- a/drivers/infiniband/hw/mlx4/alias_GUID.c
> > +++ b/drivers/infiniband/hw/mlx4/alias_GUID.c
> > @@ -499,6 +499,7 @@ static int set_guid_rec(struct ib_device *ibdev,
> >  	struct list_head *head =
> >  		&dev->sriov.alias_guid.ports_guid[port - 1].cb_list;
> >
> > +	memset(&attr, 0, sizeof(struct ib_port_attr));
>
> Can you please change above code to,
> 	memset(&attr, 0, sizeof(attr));

Sure,
We will wait a little bit more to gather additional comments
if any and resubmit the series.

Thanks for the feedback.

>
> > diff --git a/drivers/infiniband/hw/mlx4/sysfs.c
> > b/drivers/infiniband/hw/mlx4/sysfs.c
> > index 69fb5ba..5835165 100644
> > --- a/drivers/infiniband/hw/mlx4/sysfs.c
> > +++ b/drivers/infiniband/hw/mlx4/sysfs.c
> > @@ -226,6 +226,7 @@ static int add_port_entries(struct mlx4_ib_dev
> > *device, int port_num)
> >  	int ret = 0 ;
> >  	struct ib_port_attr attr;
> >
> > +	memset(&attr, 0, sizeof(struct ib_port_attr));
> Ditto.
> 	memset(&attr, 0, sizeof(attr));
>
>
> > a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> > index 4e8e78f..176417b 100644
> > --- a/drivers/infiniband/hw/mlx5/main.c
> > +++ b/drivers/infiniband/hw/mlx5/main.c
> > @@ -174,7 +174,7 @@ static int mlx5_query_port_roce(struct ib_device
> >
> >  	for (port = 1; port <= MLX5_CAP_GEN(dev->mdev, num_ports);
> > port++) {
> > +		memset(pprops, 0, sizeof(struct ib_port_attr));
> Here too.
> 		memset(pprops, 0, sizeof(*pprops));
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux