From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751373AbbJJWBO (ORCPT ); Sat, 10 Oct 2015 18:01:14 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:34506 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751081AbbJJWBN (ORCPT ); Sat, 10 Oct 2015 18:01:13 -0400 From: Dmitry Kalinkin To: Greg Kroah-Hartman , Martyn Welch , Manohar Vanga Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Dmitry Kalinkin Subject: [PATCH] vme: 8-bit status/id takes 256 values, not 255 Date: Sun, 11 Oct 2015 01:00:58 +0300 Message-Id: <1444514458-15098-1-git-send-email-dmitry.kalinkin@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes an off by one array size. Signed-off-by: Dmitry Kalinkin --- drivers/vme/vme_bridge.h | 4 +++- include/linux/vme.h | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/vme/vme_bridge.h b/drivers/vme/vme_bridge.h index 397578a..b59cbee 100644 --- a/drivers/vme/vme_bridge.h +++ b/drivers/vme/vme_bridge.h @@ -1,6 +1,8 @@ #ifndef _VME_BRIDGE_H_ #define _VME_BRIDGE_H_ +#include + #define VME_CRCSR_BUF_SIZE (508*1024) /* * Resource structures @@ -91,7 +93,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) */ diff --git a/include/linux/vme.h b/include/linux/vme.h index c013135..71e4a6d 100644 --- a/include/linux/vme.h +++ b/include/linux/vme.h @@ -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 -- 1.8.3.1