Alexey Dobriyan wrote:
> On Wed, Aug 16, 2006 at 10:09:12AM +0800, liyu wrote:
>   
>> --- linux-2.6.17.7/drivers/usb/input.orig/btp2118.c
>> +++ linux-2.6.17.7/drivers/usb/input/btp2118.c
>> +static struct usage_block btp_ff_usage_block[] = {
>> +    USAGE_BLOCK(USAGE_BTP_FF, 0, EV_FF, FF_GAIN, 0),
>> +    USAGE_BLOCK(USAGE_BTP_FF, 0, EV_FF, FF_RUMBLE, 0),
>> +    USAGE_BLOCK(USAGE_BTP_FF, 0, EV_FF, FF_CONSTANT, 0),
>> +    USAGE_BLOCK(USAGE_BTP_FF, 0, EV_FF, FF_SPRING, 0),
>> +    USAGE_BLOCK(USAGE_BTP_FF, 0, EV_FF, FF_FRICTION, 0),
>> +    USAGE_BLOCK(USAGE_BTP_FF, 0, EV_FF, FF_DAMPER, 0),
>> +    USAGE_BLOCK(USAGE_BTP_FF, 0, EV_FF, FF_INERTIA, 0),
>> +    USAGE_BLOCK(USAGE_BTP_FF, 0, EV_FF, FF_RAMP, 0),
>> +    USAGE_BLOCK(USAGE_BTP_FF, 0, EV_FF_STATUS, 0, FF_STATUS_STOPPED),
>> +    USAGE_BLOCK(USAGE_BTP_FF, 0, EV_FF_STATUS, 0, FF_STATUS_PLAYING),
>> +    USAGE_BLOCK_NULL
>>     
>
> Arrh, now I see why those define. 

I am sorry, the documentation for this interface will come soon.

> FYI, they fall into "obfuscation"
> category. Usual and readable style is:
>
>       {
>               .foo    = bar,
>               .baz    = quux,
>       }, {
>               .foo1   = bar1,
>               .baz    = quux1,
>       },
>       {}
> You don't need 0 and NULL initializations, compiler will do it for you.
>
> Exceptions exist, but just by reading snippet above I can't say wth
> USAGE_BLOCK is.
>
>   
:) I think use these macro can make code more clean, however it seem
your viewpoint is opposite with mine.

The reason of I choose this I had an impact on macros USB_DEVICE like,
thus I can not sure if this simulate
 is suitable. I would like listen more words about this.

>> +
>> +static struct hidinput_simple_driver btp_driver = {
>> +    __SIMPLE_DRIVER_INIT
>>     
>
> Impossible to understand without grep. Please, expand in place and nuke
> it altogether.
>
>   
My original idea here is information hidden. but it seem have a bit of ugly.

This macro just is

#define __SIMPLE_DRIVER_INIT \
    .owner = THIS_MODULE,

I think there must be some better means. I am thinking....







-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to