]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: s526: replace counter mode bitfield struct
authorIan Abbott <abbotti@mev.co.uk>
Thu, 19 Nov 2015 14:49:07 +0000 (14:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Dec 2015 00:00:12 +0000 (16:00 -0800)
commit1d1bf884a0f9baa40402a026d87c3579791856c9
tree65c09e81c0a67eb04648ce524bb419a900a40812
parent54a79004e1e8e42d09c253498954d21fcee49014
staging: comedi: s526: replace counter mode bitfield struct

The driver uses `struct counter_mode_register_t` to describe the 16-bit
counter mode register as a sequence of bitfield members.  The struct
appears as the type of one of the members of `union cmReg`, the other
member of which is of type `unsigned short`, so the driver can
manipulate the register value as a whole, or as individual fields.
Although this is fairly convenient, it's not that conventional.  The
code also needs to define the bitfield members in ascending or
descending order of the physical bits, depending on whether bitfields
are little- or big-endian.

Rip all that out and replace it with a bunch of macros to set and mask
out bits of the register value, as that's the more conventional way to
do it.  A bonus is that we get rid of a load of CamelCase definitions in
the process.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/s526.c