Search Linux Wireless

Re: [patch 8/9] debugfs: Revamp debugfs_create_{u,x,s}{8,16,32,64} to support signed integers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2007-12-17 at 17:43 +0100, Johannes Berg wrote:
> On Mon, 2007-12-17 at 01:20 +0100, mattias.nissler@xxxxxx 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

-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux