From: Stefano Babic <stefano.babic@babic.homelinux.org>
To: sjur.brandeland@stericsson.com
Cc: netdev@vger.kernel.org, kim.xx.lilliestierna@stericsson.com,
christian.bejram@stericsson.com,
daniel.martensson@stericsson.com
Subject: Re: [PATCH] [CAIF-RFC 4/8-v2] CAIF Protocol Stack
Date: Mon, 12 Oct 2009 14:20:01 +0200 [thread overview]
Message-ID: <4AD31EF1.2010102@babic.homelinux.org> (raw)
In-Reply-To: <1255095571-6501-5-git-send-email-sjur.brandeland@stericsson.com>
sjur.brandeland@stericsson.com wrote:
> From: Sjur Braendeland <sjur.brandeland@stericsson.com>
Hi Sjur,
>
> diff --git a/net/caif/generic/cfcnfg.c b/net/caif/generic/cfcnfg.c
> new file mode 100644
> index 0000000..3aad201
> + * NOTE: What happends destroy failure:
s/happends/happens/, there are other occurencies.
> +
> +bool cfcnfg_del_adapt_layer(struct _cfcnfg_t *cnfg, layer_t *adap_layer)
> +{
> + uint8 channel_id = 0;
> + struct cfcnfg_phyinfo *phyinfo = NULL;
> + uint8 phyid = 0;
> + CFLOG_TRACE(("cfcnfg: enter del_adaptation_layer\n"));
> +
> + cfglu_assert(adap_layer != NULL);
> + channel_id = adap_layer->id;
> + cfglu_assert(channel_id != 0);
My two cents about using assert in the code, but I prefer to get some
info from system when something goes wrong as to call in some way panic
(the assert calls BUG_ON) and blocks forever.
This line is not different as checking the adapt_layer->dn pointer some
lines after and I think an error is better recognized in that case. So
IMHO should be better something like:
if (channel_id == 0) {
CFLOG_ERROR(("cfcnfg:adap_layer->dn is NULL\n"));
return CFGLU_EINVAL;
}
> diff --git a/net/caif/generic/cfpkt_plain.c b/net/caif/generic/cfpkt_plain.c
> +#define CHECK_MEM 1
Probably you plan to use always the magic number in your buffer
management. Then should be better to remove all the #if CHECK_MEM stuff.
> +#if CHECK_MEM
> +
> +#endif
This three lines seem not needed.... ;)
Stefano
--
stefano <stefano.babic@babic.homelinux.org>
GPG Key: 0x55814DDE
Fingerprint 4E85 2A66 4CBA 497A 2A7B D3BF 5973 F216 5581 4DDE
next prev parent reply other threads:[~2009-10-12 12:20 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-09 13:39 [PATCH] [CAIF-RFC 0/8-v2] CAIF Protocol Stack sjur.brandeland
2009-10-09 13:39 ` [PATCH] [CAIF-RFC 1/8-v2] " sjur.brandeland
2009-10-09 13:39 ` [PATCH] [CAIF-RFC 2/8-v2] " sjur.brandeland
2009-10-09 13:39 ` [PATCH] [CAIF-RFC 3/8-v2] " sjur.brandeland
2009-10-09 13:39 ` [PATCH] [CAIF-RFC 4/8-v2] " sjur.brandeland
2009-10-09 13:39 ` [PATCH] [CAIF-RFC 5/8-v2] " sjur.brandeland
2009-10-09 13:39 ` [PATCH] [CAIF-RFC 6/8-v2] " sjur.brandeland
2009-10-09 13:39 ` [PATCH] [CAIF-RFC 7/8-v2] " sjur.brandeland
2009-10-09 13:39 ` [PATCH] [CAIF-RFC 8/8-v2] " sjur.brandeland
2009-10-12 13:43 ` [PATCH] [CAIF-RFC 7/8-v2] " Stefano Babic
2009-10-12 13:06 ` [PATCH] [CAIF-RFC 6/8-v2] " Stefano Babic
2009-10-09 16:43 ` [PATCH] [CAIF-RFC 5/8-v2] " Randy Dunlap
2009-10-12 12:51 ` Stefano Babic
2009-10-12 12:20 ` Stefano Babic [this message]
2009-10-12 9:28 ` [PATCH] [CAIF-RFC 2/8-v2] " Stefano Babic
2009-10-12 8:08 ` [PATCH] [CAIF-RFC 1/8-v2] " Stefano Babic
2009-10-12 8:20 ` David Miller
2009-10-12 9:41 ` [PATCH] [CAIF-RFC 0/8-v2] " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AD31EF1.2010102@babic.homelinux.org \
--to=stefano.babic@babic.homelinux.org \
--cc=christian.bejram@stericsson.com \
--cc=daniel.martensson@stericsson.com \
--cc=kim.xx.lilliestierna@stericsson.com \
--cc=netdev@vger.kernel.org \
--cc=sjur.brandeland@stericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).