Re: [PATCH 1/4] staging: comedi: make 'dev->attached' a bool bit-field

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

 



On Fri, Mar 15, 2013 at 01:15:33PM +0000, Ian Abbott wrote:
> Change the `attached` member of `struct comedi_device` to a 1-bit
> bit-field of type `bool`.  Change assigned values to `true` and `false`
> and replace or remove comparison operations with simple boolean tests.
> 
> We'll put some extra bit-fields in the gap later to save space.
> 
> Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
> ---
>  drivers/staging/comedi/comedidev.h             | 2 +-
>  drivers/staging/comedi/drivers.c               | 4 ++--
>  drivers/staging/comedi/drivers/cb_pcidas.c     | 2 +-
>  drivers/staging/comedi/drivers/cb_pcidas64.c   | 2 +-
>  drivers/staging/comedi/drivers/das16.c         | 2 +-
>  drivers/staging/comedi/drivers/das16m1.c       | 2 +-
>  drivers/staging/comedi/drivers/das1800.c       | 2 +-
>  drivers/staging/comedi/drivers/ni_660x.c       | 2 +-
>  drivers/staging/comedi/drivers/ni_at_a2150.c   | 2 +-
>  drivers/staging/comedi/drivers/ni_labpc.c      | 2 +-
>  drivers/staging/comedi/drivers/ni_mio_common.c | 2 +-
>  drivers/staging/comedi/drivers/ni_pcidio.c     | 2 +-
>  drivers/staging/comedi/drivers/s626.c          | 2 +-
>  13 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
> index f638381..bdd2936 100644
> --- a/drivers/staging/comedi/comedidev.h
> +++ b/drivers/staging/comedi/comedidev.h
> @@ -207,7 +207,7 @@ struct comedi_device {
>  
>  	const char *board_name;
>  	const void *board_ptr;
> -	int attached;
> +	bool attached:1;

I'm not objecting to this, but for some reason I thought that bit fields
could only be a 'unsigned int'.  Or am I just used to C88 or some such
really old spec of the C standard?

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux