public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] target: make one-bit bitfields unsigned
@ 2012-01-15 11:30 Dan Carpenter
  2012-01-17  2:28 ` Nicholas A. Bellinger
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-01-15 11:30 UTC (permalink / raw)
  To: Nicholas A. Bellinger
  Cc: Christoph Hellwig, Andy Grover, Joern Engel, Roland Dreier,
	linux-scsi, target-devel, kernel-janitors

Signed bitfields are a problem because instead of being 1 or 0 like
you'd expect they are 0 and -1.  It doesn't cause a problem in this case
but sparse complains:

drivers/target/iscsi/iscsi_target_core.h:564:56: error: dubious one-bit
signed bitfield

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h
index f1a02da..ebf81fd 100644
--- a/drivers/target/iscsi/iscsi_target_core.h
+++ b/drivers/target/iscsi/iscsi_target_core.h
@@ -561,8 +561,8 @@ struct iscsi_conn {
 	struct hash_desc	conn_tx_hash;
 	/* Used for scheduling TX and RX connection kthreads */
 	cpumask_var_t		conn_cpumask;
-	int			conn_rx_reset_cpumask:1;
-	int			conn_tx_reset_cpumask:1;
+	unsigned int		conn_rx_reset_cpumask:1;
+	unsigned int		conn_tx_reset_cpumask:1;
 	/* list_head of struct iscsi_cmd for this connection */
 	struct list_head	conn_cmd_list;
 	struct list_head	immed_queue_list;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] target: make one-bit bitfields unsigned
  2012-01-15 11:30 [patch] target: make one-bit bitfields unsigned Dan Carpenter
@ 2012-01-17  2:28 ` Nicholas A. Bellinger
  0 siblings, 0 replies; 2+ messages in thread
From: Nicholas A. Bellinger @ 2012-01-17  2:28 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Christoph Hellwig, Andy Grover, Joern Engel, Roland Dreier,
	linux-scsi, target-devel, kernel-janitors

On Sun, 2012-01-15 at 14:30 +0300, Dan Carpenter wrote:
> Signed bitfields are a problem because instead of being 1 or 0 like
> you'd expect they are 0 and -1.  It doesn't cause a problem in this case
> but sparse complains:
> 
> drivers/target/iscsi/iscsi_target_core.h:564:56: error: dubious one-bit
> signed bitfield
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h
> index f1a02da..ebf81fd 100644
> --- a/drivers/target/iscsi/iscsi_target_core.h
> +++ b/drivers/target/iscsi/iscsi_target_core.h
> @@ -561,8 +561,8 @@ struct iscsi_conn {
>  	struct hash_desc	conn_tx_hash;
>  	/* Used for scheduling TX and RX connection kthreads */
>  	cpumask_var_t		conn_cpumask;
> -	int			conn_rx_reset_cpumask:1;
> -	int			conn_tx_reset_cpumask:1;
> +	unsigned int		conn_rx_reset_cpumask:1;
> +	unsigned int		conn_tx_reset_cpumask:1;
>  	/* list_head of struct iscsi_cmd for this connection */
>  	struct list_head	conn_cmd_list;
>  	struct list_head	immed_queue_list;
> --

Applied to lio-core.  Thanks Dan!


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-17  2:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-15 11:30 [patch] target: make one-bit bitfields unsigned Dan Carpenter
2012-01-17  2:28 ` Nicholas A. Bellinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox