Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-12 Thread Andy Shevchenko
On Sat, Mar 10, 2018 at 10:10 PM, Michał Kępień wrote: >> > #define OP_GET_CAPS 0x0 >> > #define OP_GET_EVENTS 0x1 >> > #define OP_SET 0x1 >> > #define OP_GET 0x2 >> > #define OP_GET_EXT 0x4 >> > #define OP_SET_EXT 0x5 >> >> This one looks

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-12 Thread Andy Shevchenko
On Sat, Mar 10, 2018 at 10:10 PM, Michał Kępień wrote: >> > #define OP_GET_CAPS 0x0 >> > #define OP_GET_EVENTS 0x1 >> > #define OP_SET 0x1 >> > #define OP_GET 0x2 >> > #define OP_GET_EXT 0x4 >> > #define OP_SET_EXT 0x5 >> >> This one looks pretty much okay

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-10 Thread Michał Kępień
> > #define OP_GET_CAPS 0x0 > > #define OP_GET_EVENTS 0x1 > > #define OP_SET 0x1 > > #define OP_GET 0x2 > > #define OP_GET_EXT 0x4 > > #define OP_SET_EXT 0x5 > > This one looks pretty much okay (logical pairs IIUC). Sadly, no, these are not logical pairs. But

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-10 Thread Michał Kępień
> > #define OP_GET_CAPS 0x0 > > #define OP_GET_EVENTS 0x1 > > #define OP_SET 0x1 > > #define OP_GET 0x2 > > #define OP_GET_EXT 0x4 > > #define OP_SET_EXT 0x5 > > This one looks pretty much okay (logical pairs IIUC). Sadly, no, these are not logical pairs. But

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-07 Thread Andy Shevchenko
On Tue, Mar 6, 2018 at 10:59 PM, Michał Kępień wrote: > #define OP_GET_CAPS 0x0 > #define OP_GET_EVENTS 0x1 > #define OP_SET 0x1 > #define OP_GET 0x2 > #define OP_GET_EXT 0x4 > #define OP_SET_EXT 0x5 This one looks pretty much okay (logical

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-07 Thread Andy Shevchenko
On Tue, Mar 6, 2018 at 10:59 PM, Michał Kępień wrote: > #define OP_GET_CAPS 0x0 > #define OP_GET_EVENTS 0x1 > #define OP_SET 0x1 > #define OP_GET 0x2 > #define OP_GET_EXT 0x4 > #define OP_SET_EXT 0x5 This one looks pretty much okay (logical pairs IIUC). --

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-06 Thread Michał Kępień
Andy, > What I'm trying to tell is about consistency of style. I completely agree with all you wrote, those are all good suggestions. But you started your reasoning with: > So, imagine if we have two bitfields in some register, one with one > bit and the other with two. We are not looking at a

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-06 Thread Michał Kępień
Andy, > What I'm trying to tell is about consistency of style. I completely agree with all you wrote, those are all good suggestions. But you started your reasoning with: > So, imagine if we have two bitfields in some register, one with one > bit and the other with two. We are not looking at a

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-06 Thread Andy Shevchenko
On Tue, Mar 6, 2018 at 1:16 AM, Darren Hart wrote: > On Sun, Mar 04, 2018 at 08:44:26PM +0100, Michał Kępień wrote: >> > On Wed, Feb 28, 2018 at 06:08:52PM +0200, Andy Shevchenko wrote: >> > > On Tue, Feb 27, 2018 at 11:15 PM, Micha?? K??pie?? >> > >

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-06 Thread Andy Shevchenko
On Tue, Mar 6, 2018 at 1:16 AM, Darren Hart wrote: > On Sun, Mar 04, 2018 at 08:44:26PM +0100, Michał Kępień wrote: >> > On Wed, Feb 28, 2018 at 06:08:52PM +0200, Andy Shevchenko wrote: >> > > On Tue, Feb 27, 2018 at 11:15 PM, Micha?? K??pie?? >> > > wrote: >> > > > Various functions exposed by

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-05 Thread Darren Hart
On Sun, Mar 04, 2018 at 08:44:26PM +0100, Michał Kępień wrote: > > On Wed, Feb 28, 2018 at 06:08:52PM +0200, Andy Shevchenko wrote: > > > On Tue, Feb 27, 2018 at 11:15 PM, Micha?? K??pie?? > > > wrote: > > > > Various functions exposed by the firmware through the FUNC

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-05 Thread Darren Hart
On Sun, Mar 04, 2018 at 08:44:26PM +0100, Michał Kępień wrote: > > On Wed, Feb 28, 2018 at 06:08:52PM +0200, Andy Shevchenko wrote: > > > On Tue, Feb 27, 2018 at 11:15 PM, Micha?? K??pie?? > > > wrote: > > > > Various functions exposed by the firmware through the FUNC interface > > > > tend to

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-04 Thread Jonathan Woithe
On Sun, Mar 04, 2018 at 08:44:26PM +0100, Micha?? K??pie?? wrote: > > On Wed, Feb 28, 2018 at 06:08:52PM +0200, Andy Shevchenko wrote: > > > And plain 0 doesn't look right in this concept (something like (0 << > > > 0) would probably do it). > > > > Given that all other definitions are in terms

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-04 Thread Jonathan Woithe
On Sun, Mar 04, 2018 at 08:44:26PM +0100, Micha?? K??pie?? wrote: > > On Wed, Feb 28, 2018 at 06:08:52PM +0200, Andy Shevchenko wrote: > > > And plain 0 doesn't look right in this concept (something like (0 << > > > 0) would probably do it). > > > > Given that all other definitions are in terms

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-04 Thread Michał Kępień
> On Wed, Feb 28, 2018 at 06:08:52PM +0200, Andy Shevchenko wrote: > > On Tue, Feb 27, 2018 at 11:15 PM, Micha?? K??pie?? > > wrote: > > > Various functions exposed by the firmware through the FUNC interface > > > tend to use a consistent set of integers for denoting the type

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-04 Thread Michał Kępień
> On Wed, Feb 28, 2018 at 06:08:52PM +0200, Andy Shevchenko wrote: > > On Tue, Feb 27, 2018 at 11:15 PM, Micha?? K??pie?? > > wrote: > > > Various functions exposed by the firmware through the FUNC interface > > > tend to use a consistent set of integers for denoting the type of > > > operation

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-03 Thread Jonathan Woithe
On Wed, Feb 28, 2018 at 06:08:52PM +0200, Andy Shevchenko wrote: > On Tue, Feb 27, 2018 at 11:15 PM, Micha?? K??pie?? wrote: > > Various functions exposed by the firmware through the FUNC interface > > tend to use a consistent set of integers for denoting the type of > >

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-03-03 Thread Jonathan Woithe
On Wed, Feb 28, 2018 at 06:08:52PM +0200, Andy Shevchenko wrote: > On Tue, Feb 27, 2018 at 11:15 PM, Micha?? K??pie?? wrote: > > Various functions exposed by the firmware through the FUNC interface > > tend to use a consistent set of integers for denoting the type of > > operation to be performed

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-02-28 Thread Andy Shevchenko
On Tue, Feb 27, 2018 at 11:15 PM, Michał Kępień wrote: > Various functions exposed by the firmware through the FUNC interface > tend to use a consistent set of integers for denoting the type of > operation to be performed for a specified feature. Use named constants > instead

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-02-28 Thread Andy Shevchenko
On Tue, Feb 27, 2018 at 11:15 PM, Michał Kępień wrote: > Various functions exposed by the firmware through the FUNC interface > tend to use a consistent set of integers for denoting the type of > operation to be performed for a specified feature. Use named constants > instead of integers in each

[PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-02-27 Thread Michał Kępień
Various functions exposed by the firmware through the FUNC interface tend to use a consistent set of integers for denoting the type of operation to be performed for a specified feature. Use named constants instead of integers in each call_fext_func() invocation in order to more clearly convey the

[PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations

2018-02-27 Thread Michał Kępień
Various functions exposed by the firmware through the FUNC interface tend to use a consistent set of integers for denoting the type of operation to be performed for a specified feature. Use named constants instead of integers in each call_fext_func() invocation in order to more clearly convey the