From: Marek Lindner <lindner_marek@yahoo.de>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.net>
Subject: Re: [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: atomic variable for vis-srv activation
Date: Thu, 7 Jan 2010 13:23:28 +0800 [thread overview]
Message-ID: <201001071323.28234.lindner_marek@yahoo.de> (raw)
In-Reply-To: <20100105042058.GA3102@Linus-Debian>
On Tuesday 05 January 2010 12:20:58 Linus Lüssing wrote:
> Hmm, so far we are having too modes only, vis server being enabled
> or disabled. But in those packet functions we are talking about
> types (two ones only so far again) instead. In the second one I found it
> ok to use the defines, but for the proc.c switching, I found a
> simple 0 or 1 more intuitive, as you already know that this
> function is for enabling/disabling the vis server and you don't
> have to wonder about a certain vis-types field in the vis-packet
> format. Hmm, I'm also wondering, are there any plans for
> introducing other vis_types? (What would you think about changing
> the 8 bits vis_type field to flags instead?)
I think using defines instead of hard-coded values always is the better choice.
Even if it is more intuitive for you now you never know when this code is
going to be extended. In addition, you still want to understand the code in 6
months and/or make it easier of others to understand.
Whether it makes sense to rename more variables / defines is another discussion
and belongs into another patch. :)
> Damn it, you are right :). I assume, that it'd be ok to remove the default
> value being set in vis_init and explicitly setting this field
> every time a new vis packet gets generated in generate_vis_packet()
> (instead of updating this variable from proc.c too)?
I think a default value is good to have. ;-)
generate_vis_packet() looks like a good place to update the packet's variable.
> Yes, sorry, you're right I'd removed the
> server/client/enabled/disabled things and added just 0/1 as input
> values for proc to make the syntax similar to the aggregation
> stuff and simple in general for the kernel module. I'm going to put
> that in a seperate patch.
Great.
Regards,
Marek
next prev parent reply other threads:[~2010-01-07 5:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-31 3:37 [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: atomic variable for vis-srv activation =?UTF-8?q?Linus=20L=C3=BCssing?=
2010-01-02 19:26 ` Marek Lindner
2010-01-05 4:20 ` Linus Lüssing
2010-01-05 7:41 ` Andrew Lunn
2010-01-07 5:23 ` Marek Lindner [this message]
2010-01-11 4:57 ` [B.A.T.M.A.N.] [PATCH] " Linus Lüssing
2010-01-13 1:30 ` Linus Lüssing
[not found] ` <201001151124.25877.lindner_marek@yahoo.de>
2010-01-15 18:34 ` Sven Eckelmann
2010-01-15 18:39 ` Sven Eckelmann
2010-01-15 18:50 ` Andrew Lunn
2010-01-18 20:42 ` Linus Lüssing
2010-01-20 2:02 ` Marek Lindner
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=201001071323.28234.lindner_marek@yahoo.de \
--to=lindner_marek@yahoo.de \
--cc=b.a.t.m.a.n@lists.open-mesh.net \
--cc=b.a.t.m.a.n@lists.open-mesh.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