phy: renesas: phy-rcar-gen2: Fix the array off by one warning
authorBiju Das <biju.das@bp.renesas.com>
Wed, 9 Oct 2019 16:12:49 +0000 (17:12 +0100)
committerKishon Vijay Abraham I <kishon@ti.com>
Thu, 31 Oct 2019 11:24:01 +0000 (16:54 +0530)
commitc9baab38fe0e28762d0d67611cbe2aef0fb3fc72
treea078e187f66c167ff81db6c5f61c7faf2116a49e
parent82b5d164415549e74cfa1f9156ffd4463d0a76e2
phy: renesas: phy-rcar-gen2: Fix the array off by one warning

Fix the below smatch warning by adding variable check rather than the
hardcoded value.
warn: array off by one? 'data->select_value[channel_num]'

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Biju Das <biju.das@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/renesas/phy-rcar-gen2.c