]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
vme: 8-bit status/id takes 256 values, not 255
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>
Sat, 10 Oct 2015 22:00:58 +0000 (01:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Oct 2015 05:03:00 +0000 (22:03 -0700)
Fixes an off by one array size.

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/vme/vme_bridge.h
include/linux/vme.h

index 934949abd7457c8072c47844f7ea555c05e5bb4e..a3ef63b336e44384f0a1a7621482c4ccc2624388 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _VME_BRIDGE_H_
 #define _VME_BRIDGE_H_
 
+#include <linux/vme.h>
+
 #define VME_CRCSR_BUF_SIZE (508*1024)
 /*
  * Resource structures
@@ -88,7 +90,7 @@ struct vme_callback {
 
 struct vme_irq {
        int count;
-       struct vme_callback callback[255];
+       struct vme_callback callback[VME_NUM_STATUSID];
 };
 
 /* Allow 16 characters for name (including null character) */
index c0131358f351519a279aefa602c26399ff2319c1..71e4a6dec5ac77a4cfdaf1483ae2c8866e7fd032 100644 (file)
@@ -81,6 +81,9 @@ struct vme_resource {
 
 extern struct bus_type vme_bus_type;
 
+/* Number of VME interrupt vectors */
+#define VME_NUM_STATUSID       256
+
 /* VME_MAX_BRIDGES comes from the type of vme_bus_numbers */
 #define VME_MAX_BRIDGES                (sizeof(unsigned int)*8)
 #define VME_MAX_SLOTS          32