lkml.org 
[lkml]   [2014]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] drbd: change one-bit bitfield to be an unsigned int
On Sun, 15 Jun 2014, Martin Kepplinger wrote:

> The one-bit bitfield has no negative values and thus becomes an
> unsigned int.
>
> Signed-off-by: Martin Kepplinger <martink@posteo.de>

I'm unsure what you're correcting here. These bitfields are inherently
signed, "int local:1" and "int waiting:1" are signed. They can have one
of two values, 0 or -1. So I don't know what you're saying in your
changelog.

This patch would only make sense if something is testing `local' or
`waiting' to be equal to 1. Is that what you're fixing? If so, please
specify it in the changelog with an example.

> ---
> Sorry for the visually ugly first patch. Take this one, if any.
>
> thanks,
> martin
>
>
> drivers/block/drbd/drbd_interval.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/drbd/drbd_interval.h b/drivers/block/drbd/drbd_interval.h
> index f38fcb0..8d670e6 100644
> --- a/drivers/block/drbd/drbd_interval.h
> +++ b/drivers/block/drbd/drbd_interval.h
> @@ -9,8 +9,8 @@ struct drbd_interval {
> sector_t sector; /* start sector of the interval */
> unsigned int size; /* size in bytes */
> sector_t end; /* highest interval end in subtree */
> - int local:1 /* local or remote request? */;
> - int waiting:1;
> + unsigned int local:1; /* local or remote request? */
> + unsigned int waiting:1;
> };
>
> static inline void drbd_clear_interval(struct drbd_interval *i)


\
 
 \ /
  Last update: 2014-06-16 12:21    [W:0.090 / U:23.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site