All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: Jesper Juhl <juhl-lkml@dif.dk>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: [PATCH 4/7] dlm: configuration
Date: Tue, 26 Apr 2005 14:49:40 +0800	[thread overview]
Message-ID: <20050426064940.GE12096@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.62.0504251749090.2941@dragon.hyggekrogen.localhost>

On Mon, Apr 25, 2005 at 05:53:49PM +0200, Jesper Juhl wrote:
> On Mon, 25 Apr 2005, David Teigland wrote:

> > +static ssize_t dlm_id_store(struct dlm_ls *ls, const char *buf, size_t len)
> > +{
> > +	ls->ls_global_id = simple_strtol(buf, NULL, 0);
> > +	return len;
> > +}
>
> What's the point of `len' in these two functions? 
> You pass in `len`, don't use it at all, then return the value. I fail to 
> see the usefulness. Why not just have the function return void and omit 
> the `len' parameter?

Do I have a choice?  Aren't these stipulated by sysfs?

static ssize_t dlm_attr_store(struct kobject *kobj, struct attribute *attr,
                              const char *buf, size_t len)
{
        struct dlm_ls *ls  = container_of(kobj, struct dlm_ls, ls_kobj);
        struct dlm_attr *a = container_of(attr, struct dlm_attr, attr);
        return a->store ? a->store(ls, buf, len) : len;
}

static struct sysfs_ops dlm_attr_ops = {
        .show  = dlm_attr_show,
        .store = dlm_attr_store,
};

Dave


  reply	other threads:[~2005-04-26  6:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-25 15:12 [PATCH 4/7] dlm: configuration David Teigland
2005-04-25 15:53 ` Jesper Juhl
2005-04-26  6:49   ` David Teigland [this message]
2005-04-26 10:08     ` Jesper Juhl

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=20050426064940.GE12096@redhat.com \
    --to=teigland@redhat.com \
    --cc=akpm@osdl.org \
    --cc=juhl-lkml@dif.dk \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.