Re: [PATCH next] scsi: fcoe: fix off by one in eth2fc_speed()

2016-09-26 Thread Martin K. Petersen
> "Vincent" == Vincent Stehlé  writes:

Vincent> This should be "< ARRAY_SIZE()" instead of "<= ARRAY_SIZE()".

Applied to 4.9/scsi-queue.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH next] scsi: fcoe: fix off by one in eth2fc_speed()

2016-09-22 Thread Johannes Thumshirn
On Wed, Sep 21, 2016 at 10:54:07PM +0200, Vincent Stehlé wrote:
> This should be "< ARRAY_SIZE()" instead of "<= ARRAY_SIZE()".
> 
> Fixes: 0b924e5505a568e7 ("scsi: fcoe: provide translation table between 
> Ethernet and FC port speeds")
> Signed-off-by: Vincent Stehlé 
> Cc: Johannes Thumshirn 
> Cc: "Martin K. Petersen" 
> ---
> 
> Hi,
> 
> I saw that in Linux next-20160921.
> 
> Best regards,
> 
> Vincent.
> 
>  drivers/scsi/fcoe/fcoe_transport.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/fcoe/fcoe_transport.c 
> b/drivers/scsi/fcoe/fcoe_transport.c
> index c164eec..375c536 100644
> --- a/drivers/scsi/fcoe/fcoe_transport.c
> +++ b/drivers/scsi/fcoe/fcoe_transport.c
> @@ -110,7 +110,7 @@ static inline u32 eth2fc_speed(u32 eth_port_speed)
>  {
>   int i;
>  
> - for (i = 0; i <= ARRAY_SIZE(fcoe_port_speed_mapping); i++) {
> + for (i = 0; i < ARRAY_SIZE(fcoe_port_speed_mapping); i++) {
>   if (fcoe_port_speed_mapping[i].eth_port_speed == eth_port_speed)
>   return fcoe_port_speed_mapping[i].fc_port_speed;
>   }
> -- 
> 2.9.3
> 

Good catch,
Reviewed-by: Johannes Thumshirn 

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH next] scsi: fcoe: fix off by one in eth2fc_speed()

2016-09-21 Thread Vincent Stehlé
This should be "< ARRAY_SIZE()" instead of "<= ARRAY_SIZE()".

Fixes: 0b924e5505a568e7 ("scsi: fcoe: provide translation table between 
Ethernet and FC port speeds")
Signed-off-by: Vincent Stehlé 
Cc: Johannes Thumshirn 
Cc: "Martin K. Petersen" 
---

Hi,

I saw that in Linux next-20160921.

Best regards,

Vincent.

 drivers/scsi/fcoe/fcoe_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/fcoe/fcoe_transport.c 
b/drivers/scsi/fcoe/fcoe_transport.c
index c164eec..375c536 100644
--- a/drivers/scsi/fcoe/fcoe_transport.c
+++ b/drivers/scsi/fcoe/fcoe_transport.c
@@ -110,7 +110,7 @@ static inline u32 eth2fc_speed(u32 eth_port_speed)
 {
int i;
 
-   for (i = 0; i <= ARRAY_SIZE(fcoe_port_speed_mapping); i++) {
+   for (i = 0; i < ARRAY_SIZE(fcoe_port_speed_mapping); i++) {
if (fcoe_port_speed_mapping[i].eth_port_speed == eth_port_speed)
return fcoe_port_speed_mapping[i].fc_port_speed;
}
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html