Commit 32b6b291 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: Fix ULTRA_VBUS_DEVICEINFO

Remove the typedef from ULTRA_VBUS_DEVICEINFO and use struct
ultra_vbus_deviceinfo instead. Fix CamelCase member names:

devType => devtype
drvName => drvname
infoStrings => infostrs

Fix indentation on function definitions that were affected by the
structure's name change.
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a09ad889
...@@ -79,13 +79,12 @@ struct ultra_vbus_channel_protocol { ...@@ -79,13 +79,12 @@ struct ultra_vbus_channel_protocol {
ULTRA_CHANNEL_PROTOCOL ChannelHeader; /* initialized by server */ ULTRA_CHANNEL_PROTOCOL ChannelHeader; /* initialized by server */
ULTRA_VBUS_HEADERINFO HdrInfo; /* initialized by server */ ULTRA_VBUS_HEADERINFO HdrInfo; /* initialized by server */
/* the remainder of this channel is filled in by the client */ /* the remainder of this channel is filled in by the client */
ULTRA_VBUS_DEVICEINFO ChpInfo; /* describes client chipset device and struct ultra_vbus_deviceinfo ChpInfo;
* driver */ /* describes client chipset device and driver */
ULTRA_VBUS_DEVICEINFO BusInfo; /* describes client bus device and struct ultra_vbus_deviceinfo BusInfo;
* driver */ /* describes client bus device and driver */
ULTRA_VBUS_DEVICEINFO DevInfo[0]; /* describes client device and struct ultra_vbus_deviceinfo DevInfo[0];
* driver for */ /* describes client device and driver for each device on the bus */
/* each device on the bus */
}; };
#define VBUS_CH_SIZE_EXACT(MAXDEVICES) \ #define VBUS_CH_SIZE_EXACT(MAXDEVICES) \
......
...@@ -25,13 +25,13 @@ ...@@ -25,13 +25,13 @@
* It is filled in by the client side to provide info about the device * It is filled in by the client side to provide info about the device
* and driver from the client's perspective. * and driver from the client's perspective.
*/ */
typedef struct _ULTRA_VBUS_DEVICEINFO { struct ultra_vbus_deviceinfo {
u8 devType[16]; /* short string identifying the device type */ u8 devtype[16]; /* short string identifying the device type */
u8 drvName[16]; /* driver .sys file name */ u8 drvname[16]; /* driver .sys file name */
u8 infoStrings[96]; /* sequence of tab-delimited id strings: */ u8 infostrs[96]; /* sequence of tab-delimited id strings: */
/* <DRIVER_REV> <DRIVER_VERTAG> <DRIVER_COMPILETIME> */ /* <DRIVER_REV> <DRIVER_VERTAG> <DRIVER_COMPILETIME> */
u8 reserved[128]; /* pad size to 256 bytes */ u8 reserved[128]; /* pad size to 256 bytes */
} ULTRA_VBUS_DEVICEINFO; };
#pragma pack(pop) #pragma pack(pop)
...@@ -147,15 +147,15 @@ vbuschannel_itoa(char *p, int remain, int num) ...@@ -147,15 +147,15 @@ vbuschannel_itoa(char *p, int remain, int num)
* Returns the number of bytes written to <p>. * Returns the number of bytes written to <p>.
*/ */
static inline int static inline int
vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO *devinfo, vbuschannel_devinfo_to_string(struct ultra_vbus_deviceinfo *devinfo,
char *p, int remain, int devix) char *p, int remain, int devix)
{ {
char *psrc; char *psrc;
int nsrc, x, i, pad; int nsrc, x, i, pad;
int chars = 0; int chars = 0;
psrc = &(devinfo->devType[0]); psrc = &(devinfo->devtype[0]);
nsrc = sizeof(devinfo->devType); nsrc = sizeof(devinfo->devtype);
if (vbuschannel_sanitize_buffer(NULL, 0, psrc, nsrc) <= 0) if (vbuschannel_sanitize_buffer(NULL, 0, psrc, nsrc) <= 0)
return 0; return 0;
...@@ -184,8 +184,8 @@ vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO *devinfo, ...@@ -184,8 +184,8 @@ vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO *devinfo,
VBUSCHANNEL_ADDACHAR(' ', p, remain, chars); VBUSCHANNEL_ADDACHAR(' ', p, remain, chars);
/* emit driver name */ /* emit driver name */
psrc = &(devinfo->drvName[0]); psrc = &(devinfo->drvname[0]);
nsrc = sizeof(devinfo->drvName); nsrc = sizeof(devinfo->drvname);
x = vbuschannel_sanitize_buffer(p, remain, psrc, nsrc); x = vbuschannel_sanitize_buffer(p, remain, psrc, nsrc);
p += x; p += x;
remain -= x; remain -= x;
...@@ -196,8 +196,8 @@ vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO *devinfo, ...@@ -196,8 +196,8 @@ vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO *devinfo,
VBUSCHANNEL_ADDACHAR(' ', p, remain, chars); VBUSCHANNEL_ADDACHAR(' ', p, remain, chars);
/* emit strings */ /* emit strings */
psrc = &(devinfo->infoStrings[0]); psrc = &(devinfo->infostrs[0]);
nsrc = sizeof(devinfo->infoStrings); nsrc = sizeof(devinfo->infostrs);
x = vbuschannel_sanitize_buffer(p, remain, psrc, nsrc); x = vbuschannel_sanitize_buffer(p, remain, psrc, nsrc);
p += x; p += x;
remain -= x; remain -= x;
......
...@@ -114,18 +114,18 @@ int uisutil_add_proc_line_ex(int *total, char **buffer, int *buffer_remaining, ...@@ -114,18 +114,18 @@ int uisutil_add_proc_line_ex(int *total, char **buffer, int *buffer_remaining,
char *format, ...); char *format, ...);
int uisctrl_register_req_handler(int type, void *fptr, int uisctrl_register_req_handler(int type, void *fptr,
ULTRA_VBUS_DEVICEINFO *chipset_driver_info); struct ultra_vbus_deviceinfo *chipset_driver_info);
int uisctrl_register_req_handler_ex(uuid_le switch_guid, int uisctrl_register_req_handler_ex(uuid_le switch_guid,
const char *switch_type_name, const char *switch_type_name,
int (*fptr)(struct io_msgs *), int (*fptr)(struct io_msgs *),
unsigned long min_channel_bytes, unsigned long min_channel_bytes,
int (*svr_channel_ok)(unsigned long int (*svr_channel_ok)(unsigned long
channel_bytes), channel_bytes),
int (*svr_channel_init)(void *x, int (*svr_channel_init)(void *x,
unsigned char *client_str, unsigned char *client_str,
u32 client_str_len, u32 client_str_len,
u64 bytes), u64 bytes),
ULTRA_VBUS_DEVICEINFO *chipset_driver_info); struct ultra_vbus_deviceinfo *chipset_driver_info);
int uisctrl_unregister_req_handler_ex(uuid_le switch_uuid); int uisctrl_unregister_req_handler_ex(uuid_le switch_uuid);
unsigned char *util_map_virt(struct phys_info *sg); unsigned char *util_map_virt(struct phys_info *sg);
......
...@@ -26,19 +26,19 @@ ...@@ -26,19 +26,19 @@
#define TARGET_HOSTNAME "linuxguest" #define TARGET_HOSTNAME "linuxguest"
static inline void bus_device_info_init( static inline void bus_device_info_init(
ULTRA_VBUS_DEVICEINFO * bus_device_info_ptr, struct ultra_vbus_deviceinfo *bus_device_info_ptr,
const char *dev_type, const char *drv_name, const char *dev_type, const char *drv_name,
const char *ver, const char *ver_tag) const char *ver, const char *ver_tag)
{ {
memset(bus_device_info_ptr, 0, sizeof(ULTRA_VBUS_DEVICEINFO)); memset(bus_device_info_ptr, 0, sizeof(struct ultra_vbus_deviceinfo));
snprintf(bus_device_info_ptr->devType, snprintf(bus_device_info_ptr->devtype,
sizeof(bus_device_info_ptr->devType), sizeof(bus_device_info_ptr->devtype),
"%s", (dev_type) ? dev_type : "unknownType"); "%s", (dev_type) ? dev_type : "unknownType");
snprintf(bus_device_info_ptr->drvName, snprintf(bus_device_info_ptr->drvname,
sizeof(bus_device_info_ptr->drvName), sizeof(bus_device_info_ptr->drvname),
"%s", (drv_name) ? drv_name : "unknownDriver"); "%s", (drv_name) ? drv_name : "unknownDriver");
snprintf(bus_device_info_ptr->infoStrings, snprintf(bus_device_info_ptr->infostrs,
sizeof(bus_device_info_ptr->infoStrings), "%s\t%s\t%s", sizeof(bus_device_info_ptr->infostrs), "%s\t%s\t%s",
(ver) ? ver : "unknownVer", (ver) ? ver : "unknownVer",
(ver_tag) ? ver_tag : "unknownVerTag", (ver_tag) ? ver_tag : "unknownVerTag",
TARGET_HOSTNAME); TARGET_HOSTNAME);
......
...@@ -75,7 +75,7 @@ EXPORT_SYMBOL_GPL(uisutil_add_proc_line_ex); ...@@ -75,7 +75,7 @@ EXPORT_SYMBOL_GPL(uisutil_add_proc_line_ex);
int int
uisctrl_register_req_handler(int type, void *fptr, uisctrl_register_req_handler(int type, void *fptr,
ULTRA_VBUS_DEVICEINFO *chipset_driver_info) struct ultra_vbus_deviceinfo *chipset_driver_info)
{ {
LOGINF("type = %d, fptr = 0x%p.\n", type, fptr); LOGINF("type = %d, fptr = 0x%p.\n", type, fptr);
...@@ -106,15 +106,14 @@ EXPORT_SYMBOL_GPL(uisctrl_register_req_handler); ...@@ -106,15 +106,14 @@ EXPORT_SYMBOL_GPL(uisctrl_register_req_handler);
int int
uisctrl_register_req_handler_ex(uuid_le switch_uuid, uisctrl_register_req_handler_ex(uuid_le switch_uuid,
const char *switch_type_name, const char *switch_type_name,
int (*controlfunc)(struct io_msgs *), int (*controlfunc)(struct io_msgs *),
unsigned long min_channel_bytes, unsigned long min_channel_bytes,
int (*server_channel_ok)(unsigned long int (*server_channel_ok)(unsigned long channel_bytes),
channel_bytes), int (*server_channel_init)(void *x,
int (*server_channel_init)(void *x,
unsigned char *client_str, unsigned char *client_str,
u32 client_str_len, u64 bytes), u32 client_str_len, u64 bytes),
ULTRA_VBUS_DEVICEINFO *chipset_driver_info) struct ultra_vbus_deviceinfo *chipset_driver_info)
{ {
struct req_handler_info *pReqHandlerInfo; struct req_handler_info *pReqHandlerInfo;
int rc = 0; /* assume failure */ int rc = 0; /* assume failure */
......
...@@ -137,7 +137,7 @@ static struct device virtpci_rootbus_device = { ...@@ -137,7 +137,7 @@ static struct device virtpci_rootbus_device = {
}; };
/* filled in with info about parent chipset driver when we register with it */ /* filled in with info about parent chipset driver when we register with it */
static ULTRA_VBUS_DEVICEINFO Chipset_DriverInfo; static struct ultra_vbus_deviceinfo Chipset_DriverInfo;
static const struct sysfs_ops virtpci_driver_sysfs_ops = { static const struct sysfs_ops virtpci_driver_sysfs_ops = {
.show = virtpci_driver_attr_show, .show = virtpci_driver_attr_show,
...@@ -152,7 +152,7 @@ static struct virtpci_dev *VpcidevListHead; ...@@ -152,7 +152,7 @@ static struct virtpci_dev *VpcidevListHead;
static DEFINE_RWLOCK(VpcidevListLock); static DEFINE_RWLOCK(VpcidevListLock);
/* filled in with info about this driver, wrt it servicing client busses */ /* filled in with info about this driver, wrt it servicing client busses */
static ULTRA_VBUS_DEVICEINFO Bus_DriverInfo; static struct ultra_vbus_deviceinfo Bus_DriverInfo;
/*****************************************************/ /*****************************************************/
/* debugfs entries */ /* debugfs entries */
...@@ -187,7 +187,7 @@ int WAIT_FOR_IO_CHANNEL(ULTRA_IO_CHANNEL_PROTOCOL __iomem *chanptr) ...@@ -187,7 +187,7 @@ int WAIT_FOR_IO_CHANNEL(ULTRA_IO_CHANNEL_PROTOCOL __iomem *chanptr)
/* Write the contents of <info> to the ULTRA_VBUS_CHANNEL_PROTOCOL.ChpInfo. */ /* Write the contents of <info> to the ULTRA_VBUS_CHANNEL_PROTOCOL.ChpInfo. */
static int write_vbus_chpInfo(struct ultra_vbus_channel_protocol *chan, static int write_vbus_chpInfo(struct ultra_vbus_channel_protocol *chan,
ULTRA_VBUS_DEVICEINFO *info) struct ultra_vbus_deviceinfo *info)
{ {
int off; int off;
...@@ -206,7 +206,7 @@ static int write_vbus_chpInfo(struct ultra_vbus_channel_protocol *chan, ...@@ -206,7 +206,7 @@ static int write_vbus_chpInfo(struct ultra_vbus_channel_protocol *chan,
/* Write the contents of <info> to the ULTRA_VBUS_CHANNEL_PROTOCOL.BusInfo. */ /* Write the contents of <info> to the ULTRA_VBUS_CHANNEL_PROTOCOL.BusInfo. */
static int write_vbus_busInfo(struct ultra_vbus_channel_protocol *chan, static int write_vbus_busInfo(struct ultra_vbus_channel_protocol *chan,
ULTRA_VBUS_DEVICEINFO *info) struct ultra_vbus_deviceinfo *info)
{ {
int off; int off;
...@@ -228,7 +228,7 @@ static int write_vbus_busInfo(struct ultra_vbus_channel_protocol *chan, ...@@ -228,7 +228,7 @@ static int write_vbus_busInfo(struct ultra_vbus_channel_protocol *chan,
*/ */
static int static int
write_vbus_devInfo(struct ultra_vbus_channel_protocol *chan, write_vbus_devInfo(struct ultra_vbus_channel_protocol *chan,
ULTRA_VBUS_DEVICEINFO *info, int devix) struct ultra_vbus_deviceinfo *info, int devix)
{ {
int off; int off;
...@@ -760,7 +760,7 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, int devType, ...@@ -760,7 +760,7 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, int devType,
{ {
struct device *vbus; struct device *vbus;
void *pChan; void *pChan;
ULTRA_VBUS_DEVICEINFO devInfo; struct ultra_vbus_deviceinfo devInfo;
const char *stype; const char *stype;
if (!dev) { if (!dev) {
......
...@@ -254,7 +254,7 @@ typedef struct { ...@@ -254,7 +254,7 @@ typedef struct {
void void
visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers, visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
VISORCHIPSET_BUSDEV_RESPONDERS *responders, VISORCHIPSET_BUSDEV_RESPONDERS *responders,
ULTRA_VBUS_DEVICEINFO *driverInfo); struct ultra_vbus_deviceinfo *driverInfo);
/** Register functions (in the bus driver) to get called by visorchipset /** Register functions (in the bus driver) to get called by visorchipset
* whenever a bus or device appears for which this service partition is * whenever a bus or device appears for which this service partition is
...@@ -265,7 +265,7 @@ visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers, ...@@ -265,7 +265,7 @@ visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
void void
visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers, visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
VISORCHIPSET_BUSDEV_RESPONDERS *responders, VISORCHIPSET_BUSDEV_RESPONDERS *responders,
ULTRA_VBUS_DEVICEINFO *driverInfo); struct ultra_vbus_deviceinfo *driverInfo);
typedef void (*SPARREPORTEVENT_COMPLETE_FUNC) (CONTROLVM_MESSAGE *msg, typedef void (*SPARREPORTEVENT_COMPLETE_FUNC) (CONTROLVM_MESSAGE *msg,
int status); int status);
......
...@@ -587,7 +587,7 @@ clear_chipset_events(void) ...@@ -587,7 +587,7 @@ clear_chipset_events(void)
void void
visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers, visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
VISORCHIPSET_BUSDEV_RESPONDERS *responders, VISORCHIPSET_BUSDEV_RESPONDERS *responders,
ULTRA_VBUS_DEVICEINFO *driverInfo) struct ultra_vbus_deviceinfo *driverInfo)
{ {
down(&NotifierLock); down(&NotifierLock);
if (notifiers == NULL) { if (notifiers == NULL) {
...@@ -611,7 +611,7 @@ EXPORT_SYMBOL_GPL(visorchipset_register_busdev_server); ...@@ -611,7 +611,7 @@ EXPORT_SYMBOL_GPL(visorchipset_register_busdev_server);
void void
visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers, visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
VISORCHIPSET_BUSDEV_RESPONDERS *responders, VISORCHIPSET_BUSDEV_RESPONDERS *responders,
ULTRA_VBUS_DEVICEINFO *driverInfo) struct ultra_vbus_deviceinfo *driverInfo)
{ {
down(&NotifierLock); down(&NotifierLock);
if (notifiers == NULL) { if (notifiers == NULL) {
......
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