[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B27BD8F.5040606@babic.homelinux.org>
Date: Tue, 15 Dec 2009 17:47:11 +0100
From: stefano babic <stefano.babic@...ic.homelinux.org>
To: sjur.brandeland@...ricsson.com
CC: netdev@...r.kernel.org, randy.dunlap@...cle.com,
kim.xx.lilliestierna@...ricsson.com,
christian.bejram@...ricsson.com, daniel.martensson@...ricsson.com
Subject: Re: [RFC PATCH v3 4/8] CAIF Protocol Stack
sjur.brandeland@...ricsson.com wrote:
> +struct cfcnfg *cfcnfg_create()
> +{
> + struct cfcnfg *this;
> + struct cfctrl_rsp resp;
> + /* Initiate response functions */
> + resp.enum_rsp = cfctrl_enum_resp;
> + resp.linkerror_ind = cfctrl_resp_func;
> + resp.linkdestroy_rsp = cncfg_linkdestroy_rsp;
> + resp.sleep_rsp = cfctrl_resp_func;
> + resp.wake_rsp = cfctrl_resp_func;
> + resp.restart_rsp = cfctrl_resp_func;
> + resp.radioset_rsp = cfctrl_resp_func;
> + resp.linksetup_rsp = cncfg_linkup_rsp;
> + resp.reject_rsp = cncfg_reject_rsp;
> + /* Initiate this layer */
> + this = cfglu_alloc(sizeof(struct cfcnfg));
> + memset(this, 0, sizeof(struct cfcnfg));
> + this->mux = cfmuxl_create();
> + this->ctrl = cfctrl_create();
> + this->last_phyid = 1;
> + cfctrl_set_respfuncs(this->ctrl, &resp);
Is this correct ? resp is on the stack of the function and
cfctrl_set_respfuncs sets only the pointer. After returning from this
function, the memory used by resp could be reused again. Am I right ?
> +static void cfctrl_resp_func(void)
> +{
> + CFLOG_ENTER(("cfcnfg: cfctrl_resp_func\n"));
> + CFLOG_EXIT(("cfcnfg: cfctrl_resp_func\n"));
> +}
Not really useful..
Stefano
--
stefano <stefano.babic@...ic.homelinux.org>
GPG Key: 0x55814DDE
Fingerprint 4E85 2A66 4CBA 497A 2A7B D3BF 5973 F216 5581 4DDE
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists