linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mattias Nissler <mattias.nissler@gmx.de>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linville@tuxdriver.com, stefano.brivio@polimi.it,
	linux-wireless@vger.kernel.org
Subject: Re: [patch 8/9] debugfs: Revamp debugfs_create_{u,x,s}{8,16,32,64} to support signed integers
Date: Mon, 17 Dec 2007 22:05:56 +0100	[thread overview]
Message-ID: <1197925556.7505.10.camel@localhost> (raw)
In-Reply-To: <1197909780.4885.52.camel@johannes.berg>


On Mon, 2007-12-17 at 17:43 +0100, Johannes Berg wrote:
> On Mon, 2007-12-17 at 01:20 +0100, mattias.nissler@gmx.de wrote:
> > This makes debugfs use its own file_operations for the value accessor files
> > created by debugfs_create_XXX. Having that, we can also have proper versions
> > for signed integers.
> 
> I think I'd probably prefer if this didn't duplicate all the fs/libfs.c
> simple attribute functionality but extended libfs instead to define
> attributes that can have their own print/scan functions. Or something
> like that.

Yeah, I actually tried that. See this thread:
http://lkml.org/lkml/2007/12/16/78

As far as I understand, your point is the same what Greg said.

> 
> As far as I can tell, the only reason you're doing this huge amount of
> code duplication is the "(unsigned long long)" cast in fs/libfs.c, or am
> I missing something?

Yes. Moreover, conceptually it's much cleaner to use the correct data
type.

> 
> You might even be able to get around that: define the get() function in
> simple_attr to return unsigned long long (rather than u64 as it does
> now) and then remove the cast. Then, %lld will still print a negative
> number if applicable.

And the compiler doesn't even complain. That's a cool hack ;-) But
still, it's a hack.

Mattias


      reply	other threads:[~2007-12-17 21:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-17  0:19 [patch 0/9] Rate control rework mattias.nissler
2007-12-17  0:20 ` [patch 5/9] mac80211: Introduce rate behaviour learning algorithm mattias.nissler
2007-12-17  0:20 ` [patch 9/9] mac80211: Publish rc80211_pid parameters in debugfs mattias.nissler
     [not found] ` <20071217002056.351743954@gmx.de>
2007-12-17  0:49   ` [patch 4/9] mac80211: Make PID rate control algorithm the default Johannes Berg
2007-12-17  0:50     ` Stefano Brivio
2007-12-17  0:54       ` Johannes Berg
2007-12-17  0:57         ` Stefano Brivio
2007-12-17  1:09           ` Johannes Berg
2007-12-17  9:56             ` Mattias Nissler
2007-12-17 14:48               ` John W. Linville
2007-12-17 17:42                 ` Johannes Berg
2007-12-17  9:51       ` Mattias Nissler
2007-12-17  9:54 ` [patch 0/9] Rate control rework Mattias Nissler
2007-12-17 14:05 ` Johannes Berg
2007-12-17 20:59   ` Mattias Nissler
2007-12-18 13:18     ` Johannes Berg
     [not found] ` <20071217002056.677829348@gmx.de>
2007-12-17 16:43   ` [patch 8/9] debugfs: Revamp debugfs_create_{u,x,s}{8,16,32,64} to support signed integers Johannes Berg
2007-12-17 21:05     ` Mattias Nissler [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=1197925556.7505.10.camel@localhost \
    --to=mattias.nissler@gmx.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=stefano.brivio@polimi.it \
    /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).