]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: iscsi_tcp: Explicitly cast param in iscsi_sw_tcp_host_get_param
authorNathan Chancellor <natechancellor@gmail.com>
Thu, 4 Oct 2018 01:06:15 +0000 (18:06 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 17 Oct 2018 01:50:06 +0000 (21:50 -0400)
Clang warns when one enumerated type is implicitly converted to another.

drivers/scsi/iscsi_tcp.c:803:15: warning: implicit conversion from
enumeration type 'enum iscsi_host_param' to different enumeration type
'enum iscsi_param' [-Wenum-conversion]
                                                 &addr, param, buf);
                                                        ^~~~~
1 warning generated.

iscsi_conn_get_addr_param handles ISCSI_HOST_PARAM_IPADDRESS just fine
so add an explicit cast to iscsi_param to make it clear to Clang that
this is expected behavior.

Link: https://github.com/ClangBuiltLinux/linux/issues/153
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/iscsi_tcp.c

index b025a0b7434174cea0096b23fad34aa18a22de20..23354f206533b92acd9e06f11aa777f4bf6cc5b4 100644 (file)
@@ -800,7 +800,8 @@ static int iscsi_sw_tcp_host_get_param(struct Scsi_Host *shost,
                        return rc;
 
                return iscsi_conn_get_addr_param((struct sockaddr_storage *)
-                                                &addr, param, buf);
+                                                &addr,
+                                                (enum iscsi_param)param, buf);
        default:
                return iscsi_host_get_param(shost, param, buf);
        }