scsi: isci: avoid array subscript warning
authorArnd Bergmann <arnd@arndb.de>
Fri, 18 Nov 2016 16:14:01 +0000 (17:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 Sep 2017 05:07:53 +0000 (07:07 +0200)
commitdd758f82a3bf2f11843a59188cd0d7922dbcc731
tree153a337d3e66ee9d1a3dafeadb80e35cce896448
parentf71996c3ce5d3b7ee0f581f6c2c37a19d50d72e8
scsi: isci: avoid array subscript warning

commit 5cfa2a3c7342bd0b50716c8bb32ee491af43c785 upstream.

I'm getting a new warning with gcc-7:

isci/remote_node_context.c: In function 'sci_remote_node_context_destruct':
isci/remote_node_context.c:69:16: error: array subscript is above array bounds [-Werror=array-bounds]

This is odd, since we clearly cover all values for enum
scis_sds_remote_node_context_states here. Anyway, checking for an array
overflow can't harm and it makes the warning go away.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/isci/remote_node_context.c