public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: Wrapper functions for sysfs storing
Date: Sun, 10 Oct 2010 10:12:26 +0200	[thread overview]
Message-ID: <20101010081226.GB19495@lunn.ch> (raw)
In-Reply-To: <1286685001-15227-1-git-send-email-linus.luessing@web.de>

On Sun, Oct 10, 2010 at 06:29:57AM +0200, Linus L??ssing wrote:
> Sysfs configuration options that just took a boolean value
> (enable(d)/disable(d)/0/1) and integer setting basically all had the same
> structure.
> 
> To avoid even more copy and pasting in the future and to make introducing
> new configuration parameters for batman-adv simpler, more generic
> wrapper functions are being introduced with this commit. They can deal with
> boolean and unsigned integer parameters, storing them in the specified
> atomic_t variables.
> 
> Signed-off-by: Linus L??ssing <linus.luessing@web.de>
> ---
>  bat_sysfs.c |  224 +++++++++++++++++++++++-----------------------------------
>  1 files changed, 89 insertions(+), 135 deletions(-)
> 
> diff --git a/bat_sysfs.c b/bat_sysfs.c
> index 3f551f3..60e3122 100644
> --- a/bat_sysfs.c
> +++ b/bat_sysfs.c
> @@ -39,6 +39,81 @@ struct bat_attribute bat_attr_##_name = {	\
>  	.store  = _store,			\
>  };
>  
> +static int store_switch_attr(char *buff, size_t count,
> +			     struct net_device *net_dev,
> +			     char *attr_name, atomic_t *attr)
> +{

Hi Linus

Maybe the name store_bool_attr() or store_enabled_attr() would be
clearer what it does?

	Andrew

      parent reply	other threads:[~2010-10-10  8:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-10  4:29 [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: Wrapper functions for sysfs storing Linus Lüssing
2010-10-10  4:29 ` [B.A.T.M.A.N.] [PATCH 2/5] batman-adv: Introduce generic BAT_ATTR_* macros Linus Lüssing
2010-10-10  4:39   ` Linus Lüssing
2010-10-10  8:45     ` Andrew Lunn
2010-10-10 10:34   ` Sven Eckelmann
2010-10-10 12:42   ` Marek Lindner
2010-10-10 19:00     ` Linus Lüssing
2010-10-11  8:04       ` Sven Eckelmann
2010-10-10  4:29 ` [B.A.T.M.A.N.] [PATCH 3/5] batman-adv: Make hop_penalty configurable via sysfs Linus Lüssing
2010-10-10 12:49   ` Marek Lindner
2010-10-10 14:51     ` Linus Lüssing
2010-10-10  4:30 ` [B.A.T.M.A.N.] [PATCH 4/5] batman-adv: Make number of (re)broadcasts " Linus Lüssing
2010-10-10 12:53   ` Marek Lindner
2010-10-10 14:49     ` Linus Lüssing
2010-10-10  4:30 ` [B.A.T.M.A.N.] [PATCH 5/5] batman-adv: Fix resizing of broadcast seqno buffers on if deletion Linus Lüssing
2010-10-12  9:51   ` Marek Lindner
2010-10-10  8:12 ` Andrew Lunn [this message]

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=20101010081226.GB19495@lunn.ch \
    --to=andrew@lunn.ch \
    --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