]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: unisys: added display string size define
authorErik Arfvidson <erik.arfvidson@unisys.com>
Wed, 13 Apr 2016 16:07:07 +0000 (12:07 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Apr 2016 05:09:37 +0000 (22:09 -0700)
Display string size that is guaranteed to be no longer the 99 characters.

Don't use a magic number throughout the code, define it once and use it
throughout.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/visorbus_main.c

index 547be8b50956b6f0d5db7442ad9fd863a04dd781..6216f4beb58af0dfaa67fcca06cfb22c52e3ca1a 100644 (file)
@@ -33,6 +33,9 @@ static int visorbus_forcenomatch;
 static int visorbus_debugref;
 #define SERIALLOOPBACKCHANADDR (100 * 1024 * 1024)
 
+/* Display string that is guaranteed to be no longer the 99 characters*/
+#define LINESIZE 99
+
 #define CURRENT_FILE_PC VISOR_BUS_PC_visorbus_main_c
 #define POLLJIFFIES_TESTWORK         100
 #define POLLJIFFIES_NORMALCHANNEL     10
@@ -279,7 +282,7 @@ static ssize_t typeguid_show(struct device *dev, struct device_attribute *attr,
                             char *buf)
 {
        struct visor_device *vdev = to_visor_device(dev);
-       char typeid[99];
+       char typeid[LINESIZE];
 
        if (!vdev->visorchannel)
                return 0;
@@ -291,7 +294,7 @@ static ssize_t zoneguid_show(struct device *dev, struct device_attribute *attr,
                             char *buf)
 {
        struct visor_device *vdev = to_visor_device(dev);
-       char zoneid[99];
+       char zoneid[LINESIZE];
 
        if (!vdev->visorchannel)
                return 0;