Skip to content

Commit

Permalink
scsi: iscsi_tcp: Explicitly cast param in iscsi_sw_tcp_host_get_param
Browse files Browse the repository at this point in the history
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: ClangBuiltLinux/linux#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>
  • Loading branch information
nathanchance authored and martinkpetersen committed Oct 17, 2018
1 parent f41d84d commit 2005459
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/iscsi_tcp.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 2005459

Please sign in to comment.