diff options
| author | Ian Munsie <[email protected]> | 2010-03-11 12:07:24 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2010-03-15 15:47:02 -0700 |
| commit | 8b4017d8c191822f1c93744e7876c9020e6209aa (patch) | |
| tree | 6ca42661c6483b0a27dbed39b193575b0ef2c120 /include/linux/debugobjects.h | |
| parent | dec9951b8ad86c591af7b452966bf48b307a4010 (diff) | |
i4l: silence compiler warnings for array access in Eicon DIVA ISDN driver
When compiling this driver, the compiler throws the following warnings:
drivers/isdn/hardware/eicon/message.c:8426: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8427: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8434: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8435: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8436: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8447: warning: array subscript is above array bounds
This arises from the particular semantics the driver is using to write to
the nlc array (static byte[256]). The array has a length in byte 0
followed by a T30_INFO struct starting at byte 1.
The T30_INFO struct has a number of variable length strings after the
station_id entry, which cannot be explicitly defined in the struct and the
driver accesses them with an array index to station_id beyond the length
of station_id.
This patch merely changes the semantics that the driver uses to access the
entries after the station_id entry to use the original 256 byte nlc array
taking the offset and length of the station_id entry to calculate where to
write in the array, thereby silencing the warning.
Signed-off-by: Ian Munsie <[email protected]>
Cc: Armin Schindler <[email protected]>
Cc: Karsten Keil <[email protected]>
Cc: Stoyan Gaydarov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions