DCCP protocol discussions
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: dccp@vger.kernel.org
Subject: Re: [PATCH 2/5] dccp: Implement lookup table for
Date: Mon, 22 Sep 2008 14:21:05 +0000	[thread overview]
Message-ID: <20080922142105.GB16625@ghostprotocols.net> (raw)
In-Reply-To: <1222068117-13401-3-git-send-email-gerrit@erg.abdn.ac.uk>

Em Mon, Sep 22, 2008 at 09:21:54AM +0200, Gerrit Renker escreveu:
> A lookup table for feature-negotiation information, extracted from RFC 4340/42,
> is provided by this patch. All currently known features can be found in this
> table, along with their feature location, their default value, and type.
> 
> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
> Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
> ---
>  include/linux/dccp.h |    9 ++--
>  net/dccp/feat.c      |  115 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 120 insertions(+), 4 deletions(-)
> 
> --- a/include/linux/dccp.h
> +++ b/include/linux/dccp.h
>  
> +
> +static int dccp_feat_default_value(u8 feat_num)
> +{
> +	int idx = dccp_feat_index(feat_num);
> +
> +	return idx < 0 ? : dccp_feat_table[idx].default_value;
> +}

[acme@doppio ~]$ cat dd.c
#include <stdio.h>

int main(void)
{
	int idx = -2;

	printf("%d\n", idx < 0 ? : 10);
	printf("%d\n", idx < 0 ? idx : 10);
	return 0;
}
[acme@doppio ~]$ ./dd
1
-2
[acme@doppio ~]$

Which one do you want? The boolean result as the value to be returned or
the index if it is < 0?

I tried to check on the other 4 patches on this series to check if usage
clarified if it was correct, but there is no use of
dccp_feat_default_value() on this 5 patches, perhaps it could be
deferred to when it actually gets used?

- Arnaldo

  reply	other threads:[~2008-09-22 14:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22  7:21 [PATCH 2/5] dccp: Implement lookup table for feature-negotiation information Gerrit Renker
2008-09-22 14:21 ` Arnaldo Carvalho de Melo [this message]
2008-09-22 15:45 ` [PATCH 2/5] dccp: Implement lookup table for Gerrit Renker
2008-09-22 16:49 ` Arnaldo Carvalho de Melo
2008-09-22 17:00 ` Arnaldo Carvalho de Melo
2008-09-23  3:20 ` David Miller
2008-09-24  4:41 ` Gerrit Renker
2008-09-24 13:58 ` Arnaldo Carvalho de Melo
2008-10-04  9:13 ` [PATCH 2/5] dccp: Implement lookup table for feature-negotiation information Gerrit Renker
2008-10-11  7:31 ` [PATCH 2/5] dccp: Implement lookup table for feature-negotiation Gerrit Renker
2008-11-05  6:52 ` Gerrit Renker

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=20080922142105.GB16625@ghostprotocols.net \
    --to=acme@redhat.com \
    --cc=dccp@vger.kernel.org \
    /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