Commit a22f57c6 authored by Alexander Curtin's avatar Alexander Curtin Committed by Greg Kroah-Hartman

staging: unisys: visorbus: replaced use of vague 'x' variable

In client_bus_info_show, the variable 'x' is used to create keep track
of the offset that the current 'pos' in the output buffer needs to be
incremented by. Since 'off' is already taken 'shift' was used since it's
used to shift the pointer.
Signed-off-by: default avatarAlexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8d7da1d8
...@@ -420,7 +420,7 @@ static ssize_t client_bus_info_show(struct device *dev, ...@@ -420,7 +420,7 @@ static ssize_t client_bus_info_show(struct device *dev,
struct visor_device *vdev = to_visor_device(dev); struct visor_device *vdev = to_visor_device(dev);
struct visorchannel *channel = vdev->visorchannel; struct visorchannel *channel = vdev->visorchannel;
int i, x, remain = PAGE_SIZE; int i, shift, remain = PAGE_SIZE;
unsigned long off; unsigned long off;
char *pos = buf; char *pos = buf;
u8 *partition_name; u8 *partition_name;
...@@ -430,44 +430,45 @@ static ssize_t client_bus_info_show(struct device *dev, ...@@ -430,44 +430,45 @@ static ssize_t client_bus_info_show(struct device *dev,
if (channel) { if (channel) {
if (vdev->name) if (vdev->name)
partition_name = vdev->name; partition_name = vdev->name;
x = snprintf(pos, remain, shift = snprintf(pos, remain,
"Client device / client driver info for %s partition (vbus #%d):\n", "Client device / client driver info for %s eartition (vbus #%d):\n",
partition_name, vdev->chipset_dev_no); partition_name, vdev->chipset_dev_no);
pos += x; pos += shift;
remain -= x; remain -= shift;
x = visorchannel_read(channel, shift = visorchannel_read(channel,
offsetof(struct offsetof(struct
spar_vbus_channel_protocol, spar_vbus_channel_protocol,
chp_info), chp_info),
&dev_info, sizeof(dev_info)); &dev_info, sizeof(dev_info));
if (x >= 0) { if (shift >= 0) {
x = vbuschannel_devinfo_to_string(&dev_info, pos, shift = vbuschannel_devinfo_to_string(&dev_info, pos,
remain, -1); remain, -1);
pos += x; pos += shift;
remain -= x; remain -= shift;
} }
x = visorchannel_read(channel, shift = visorchannel_read(channel,
offsetof(struct offsetof(struct
spar_vbus_channel_protocol, spar_vbus_channel_protocol,
bus_info), bus_info),
&dev_info, sizeof(dev_info)); &dev_info, sizeof(dev_info));
if (x >= 0) { if (shift >= 0) {
x = vbuschannel_devinfo_to_string(&dev_info, pos, shift = vbuschannel_devinfo_to_string(&dev_info, pos,
remain, -1); remain, -1);
pos += x; pos += shift;
remain -= x; remain -= shift;
} }
off = offsetof(struct spar_vbus_channel_protocol, dev_info); off = offsetof(struct spar_vbus_channel_protocol, dev_info);
i = 0; i = 0;
while (off + sizeof(dev_info) <= while (off + sizeof(dev_info) <=
visorchannel_get_nbytes(channel)) { visorchannel_get_nbytes(channel)) {
x = visorchannel_read(channel, shift = visorchannel_read(channel,
off, &dev_info, sizeof(dev_info)); off, &dev_info,
if (x >= 0) { sizeof(dev_info));
x = vbuschannel_devinfo_to_string if (shift >= 0) {
shift = vbuschannel_devinfo_to_string
(&dev_info, pos, remain, i); (&dev_info, pos, remain, i);
pos += x; pos += shift;
remain -= x; remain -= shift;
} }
off += sizeof(dev_info); off += sizeof(dev_info);
i++; i++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment