Re: [2.6.19 PATCH 1/7] ehea: interface to network stack

Jan-Bernd Themann
2006-08-21T13:03:54Z

Hi

On Friday 18 August 2006 16:44, Alexey Dobriyan wrote:
> > +static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr,
> > + struct port_res_cfg *pr_cfg, int queue_token)
> > +{
> > + int ret = -EINVAL;
> > + int max_rq_entries = 0;
> > + enum ehea_eq_type eq_type = EHEA_EQ;
> > + struct ehea_qp_init_attr *init_attr = NULL;
> > + struct ehea_adapter *adapter = port->adapter;
> > +
> > + memset(pr, 0, sizeof(struct ehea_port_res));
> > +
> > + pr->skb_arr_rq3 = NULL;
> > + pr->skb_arr_rq2 = NULL;
> > + pr->skb_arr_rq1 = NULL;
> > + pr->skb_arr_sq = NULL;
> > + pr->qp = NULL;
> > + pr->send_cq = NULL;
> > + pr->recv_cq = NULL;
> > + pr->send_eq = NULL;
> > + pr->recv_eq = NULL;
>
> After memset unneeded. ;-)
>

Is it valid (common in the kernel environment) to treat NULL as 0 after a memset
and thus to forget about initialization?

Thanks,
Jan-Bernd