Re: [PATCH 2/2] libiscsi: Annotate fall-through

2018-03-01 Thread Lee Duncan
On 03/01/2018 10:07 AM, Bart Van Assche wrote:
> This patch avoids that building with W=1 causes the compiler to
> complain about fall-through.
> 
> Signed-off-by: Bart Van Assche 
> Cc: Lee Duncan 
> Cc: Chris Leech 
> ---
>  drivers/scsi/libiscsi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
> index b39bfdfec337..345533f80dae 100644
> --- a/drivers/scsi/libiscsi.c
> +++ b/drivers/scsi/libiscsi.c
> @@ -1705,6 +1705,7 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct 
> scsi_cmnd *sc)
>   sc->result = DID_NO_CONNECT << 16;
>   break;
>   }
> + /* fall through */
>   case ISCSI_STATE_IN_RECOVERY:
>   reason = FAILURE_SESSION_IN_RECOVERY;
>   sc->result = DID_IMM_RETRY << 16;
> 
Signed-off-by: Lee Duncan 
-- 
Lee Duncan

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


[PATCH 2/2] libiscsi: Annotate fall-through

2018-03-01 Thread Bart Van Assche
This patch avoids that building with W=1 causes the compiler to
complain about fall-through.

Signed-off-by: Bart Van Assche 
Cc: Lee Duncan 
Cc: Chris Leech 
---
 drivers/scsi/libiscsi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index b39bfdfec337..345533f80dae 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1705,6 +1705,7 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct 
scsi_cmnd *sc)
sc->result = DID_NO_CONNECT << 16;
break;
}
+   /* fall through */
case ISCSI_STATE_IN_RECOVERY:
reason = FAILURE_SESSION_IN_RECOVERY;
sc->result = DID_IMM_RETRY << 16;
-- 
2.16.2

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


[PATCH 0/2] libiscsi: Suppress a compiler and a sparse warning

2018-03-01 Thread Bart Van Assche
Hello Lee and Chris,

The two patches in this series are what I came up with after a review of the
gcc and sparse warnings reported against kernel v4.16-rc1. Please consider
these patches for kernel v4.17.

Thanks,

Bart.

Bart Van Assche (2):
  libiscsi: Annotate locking assumptions
  libiscsi: Annotate fall-through

 drivers/scsi/libiscsi.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.16.2

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


[PATCH 1/2] libiscsi: Annotate locking assumptions

2018-03-01 Thread Bart Van Assche
This patch avoids that sparse reports the following:

drivers/scsi/libiscsi.c:1844:23: warning: context imbalance in 
'iscsi_exec_task_mgmt_fn' - unexpected unlock

Signed-off-by: Bart Van Assche 
Cc: Lee Duncan 
Cc: Chris Leech 
---
 drivers/scsi/libiscsi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 15a2fef51e38..b39bfdfec337 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1832,6 +1832,7 @@ static void iscsi_tmf_timedout(struct timer_list *t)
 static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn,
   struct iscsi_tm *hdr, int age,
   int timeout)
+   __must_hold(>frwd_lock)
 {
struct iscsi_session *session = conn->session;
struct iscsi_task *task;
-- 
2.16.2

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.