[RFC PATCH 2.6.12-rc3] dynamic driver sysfs callbacks and RFC on bmcsensor rewrite

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

 



Hi Yani,

> With respect to the lm_sensors chip drivers an int alone might make
> sense (although for bmcsensors the void* is better), but when you
> start looking at the rest of the kernel code that uses attributes the
> void * looks like a very good decision.
> 
> If you have a look at my patch for net-sysfs.c for example, its hard
> (impossible?) to imagine a way to do a similar thing with just an int
> being passed to the callbacks, and this is using static attributes.

You could always define a static array of pointers, and use the passed
int as an index to that array, thus converting the int into a pointer.
It's not very different from defining a static array of ints and passing
the int addresses as the void*, but for some reason I tend to prefer the
int -> pointer conversion (most certainly because my view if awfully
biased by my misknowledge of the kernel except for the i2c and hardware
monitoring code).

> Yes, it is starting to look like the cold hand of a dictator might be
> needed ... where is Greg anyway ;-)?

Don't blame him, I am wasting his time over IRC, this is why... ;)

-- 
Jean Delvare



[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux