staging: unisys: Remove VISORCHANNEL typedef

Remove the VISORCHANNEL typedef and rename the base VISORCHANNEL_Tag
structure to visorchannel to follow consistent naming. The longer
struct visorchannel type required additional line wrapping to remain
less than 81 characters.

Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Bryan Thompson 2014-12-05 17:09:25 -05:00 коммит произвёл Greg Kroah-Hartman
Родитель 9551bfba91
Коммит 383df64e02
5 изменённых файлов: 76 добавлений и 73 удалений

Просмотреть файл

@ -29,49 +29,48 @@
#define BOOL int
#endif
/* VISORCHANNEL is an opaque structure to users.
* Fields are declared only in the implementation .c files.
*/
typedef struct VISORCHANNEL_Tag VISORCHANNEL;
/* Note that for visorchannel_create() and visorchannel_create_overlapped(),
* <channel_bytes> and <guid> arguments may be 0 if we are a channel CLIENT.
* In this case, the values can simply be read from the channel header.
*/
VISORCHANNEL *visorchannel_create(HOSTADDRESS physaddr,
ulong channel_bytes, uuid_le guid);
VISORCHANNEL *visorchannel_create_overlapped(ulong channel_bytes,
VISORCHANNEL *parent, ulong off,
uuid_le guid);
VISORCHANNEL *visorchannel_create_with_lock(HOSTADDRESS physaddr,
ulong channel_bytes, uuid_le guid);
VISORCHANNEL *visorchannel_create_overlapped_with_lock(ulong channel_bytes,
VISORCHANNEL *parent,
ulong off, uuid_le guid);
void visorchannel_destroy(VISORCHANNEL *channel);
int visorchannel_read(VISORCHANNEL *channel, ulong offset,
struct visorchannel *visorchannel_create(HOSTADDRESS physaddr,
ulong channel_bytes, uuid_le guid);
struct visorchannel *visorchannel_create_overlapped(ulong channel_bytes,
struct visorchannel *parent,
ulong off, uuid_le guid);
struct visorchannel *visorchannel_create_with_lock(HOSTADDRESS physaddr,
ulong channel_bytes,
uuid_le guid);
struct visorchannel *visorchannel_create_overlapped_with_lock(
ulong channel_bytes,
struct visorchannel *parent,
ulong off, uuid_le guid);
void visorchannel_destroy(struct visorchannel *channel);
int visorchannel_read(struct visorchannel *channel, ulong offset,
void *local, ulong nbytes);
int visorchannel_write(VISORCHANNEL *channel, ulong offset,
int visorchannel_write(struct visorchannel *channel, ulong offset,
void *local, ulong nbytes);
int visorchannel_clear(VISORCHANNEL *channel, ulong offset,
int visorchannel_clear(struct visorchannel *channel, ulong offset,
u8 ch, ulong nbytes);
BOOL visorchannel_signalremove(VISORCHANNEL *channel, u32 queue, void *msg);
BOOL visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg);
int visorchannel_signalqueue_slots_avail(VISORCHANNEL *channel, u32 queue);
int visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, u32 queue);
HOSTADDRESS visorchannel_get_physaddr(VISORCHANNEL *channel);
ulong visorchannel_get_nbytes(VISORCHANNEL *channel);
char *visorchannel_id(VISORCHANNEL *channel, char *s);
char *visorchannel_zoneid(VISORCHANNEL *channel, char *s);
u64 visorchannel_get_clientpartition(VISORCHANNEL *channel);
uuid_le visorchannel_get_uuid(VISORCHANNEL *channel);
struct memregion *visorchannel_get_memregion(VISORCHANNEL *channel);
BOOL visorchannel_signalremove(struct visorchannel *channel, u32 queue,
void *msg);
BOOL visorchannel_signalinsert(struct visorchannel *channel, u32 queue,
void *msg);
int visorchannel_signalqueue_slots_avail(struct visorchannel *channel,
u32 queue);
int visorchannel_signalqueue_max_slots(struct visorchannel *channel, u32 queue);
HOSTADDRESS visorchannel_get_physaddr(struct visorchannel *channel);
ulong visorchannel_get_nbytes(struct visorchannel *channel);
char *visorchannel_id(struct visorchannel *channel, char *s);
char *visorchannel_zoneid(struct visorchannel *channel, char *s);
u64 visorchannel_get_clientpartition(struct visorchannel *channel);
uuid_le visorchannel_get_uuid(struct visorchannel *channel);
struct memregion *visorchannel_get_memregion(struct visorchannel *channel);
char *visorchannel_uuid_id(uuid_le *guid, char *s);
void visorchannel_debug(VISORCHANNEL *channel, int num_queues,
void visorchannel_debug(struct visorchannel *channel, int num_queues,
struct seq_file *seq, u32 off);
void visorchannel_dump_section(VISORCHANNEL *chan, char *s,
void visorchannel_dump_section(struct visorchannel *chan, char *s,
int off, int len, struct seq_file *seq);
void __iomem *visorchannel_get_header(VISORCHANNEL *channel);
void __iomem *visorchannel_get_header(struct visorchannel *channel);
#endif

Просмотреть файл

@ -28,7 +28,7 @@
#define MYDRVNAME "visorchannel"
struct VISORCHANNEL_Tag {
struct visorchannel {
struct memregion *memregion; /* from visor_memregion_create() */
struct channel_header chan_hdr;
uuid_le guid;
@ -46,18 +46,18 @@ struct VISORCHANNEL_Tag {
} safe_uis_queue;
};
/* Creates the VISORCHANNEL abstraction for a data area in memory, but does
* NOT modify this data area.
/* Creates the struct visorchannel abstraction for a data area in memory,
* but does NOT modify this data area.
*/
static VISORCHANNEL *
static struct visorchannel *
visorchannel_create_guts(HOSTADDRESS physaddr, ulong channel_bytes,
VISORCHANNEL *parent, ulong off, uuid_le guid,
struct visorchannel *parent, ulong off, uuid_le guid,
BOOL needs_lock)
{
VISORCHANNEL *p = NULL;
struct visorchannel *p = NULL;
void *rc = NULL;
p = kmalloc(sizeof(VISORCHANNEL), GFP_KERNEL|__GFP_NORETRY);
p = kmalloc(sizeof(*p), GFP_KERNEL|__GFP_NORETRY);
if (p == NULL) {
ERRDRV("allocation failed: (status=0)\n");
rc = NULL;
@ -114,7 +114,7 @@ cleanup:
return rc;
}
VISORCHANNEL *
struct visorchannel *
visorchannel_create(HOSTADDRESS physaddr, ulong channel_bytes, uuid_le guid)
{
return visorchannel_create_guts(physaddr, channel_bytes, NULL, 0, guid,
@ -122,7 +122,7 @@ visorchannel_create(HOSTADDRESS physaddr, ulong channel_bytes, uuid_le guid)
}
EXPORT_SYMBOL_GPL(visorchannel_create);
VISORCHANNEL *
struct visorchannel *
visorchannel_create_with_lock(HOSTADDRESS physaddr, ulong channel_bytes,
uuid_le guid)
{
@ -131,18 +131,19 @@ visorchannel_create_with_lock(HOSTADDRESS physaddr, ulong channel_bytes,
}
EXPORT_SYMBOL_GPL(visorchannel_create_with_lock);
VISORCHANNEL *
struct visorchannel *
visorchannel_create_overlapped(ulong channel_bytes,
VISORCHANNEL *parent, ulong off, uuid_le guid)
struct visorchannel *parent, ulong off,
uuid_le guid)
{
return visorchannel_create_guts(0, channel_bytes, parent, off, guid,
FALSE);
}
EXPORT_SYMBOL_GPL(visorchannel_create_overlapped);
VISORCHANNEL *
struct visorchannel *
visorchannel_create_overlapped_with_lock(ulong channel_bytes,
VISORCHANNEL *parent, ulong off,
struct visorchannel *parent, ulong off,
uuid_le guid)
{
return visorchannel_create_guts(0, channel_bytes, parent, off, guid,
@ -151,7 +152,7 @@ visorchannel_create_overlapped_with_lock(ulong channel_bytes,
EXPORT_SYMBOL_GPL(visorchannel_create_overlapped_with_lock);
void
visorchannel_destroy(VISORCHANNEL *channel)
visorchannel_destroy(struct visorchannel *channel)
{
if (channel == NULL)
return;
@ -164,14 +165,14 @@ visorchannel_destroy(VISORCHANNEL *channel)
EXPORT_SYMBOL_GPL(visorchannel_destroy);
HOSTADDRESS
visorchannel_get_physaddr(VISORCHANNEL *channel)
visorchannel_get_physaddr(struct visorchannel *channel)
{
return visor_memregion_get_physaddr(channel->memregion);
}
EXPORT_SYMBOL_GPL(visorchannel_get_physaddr);
ulong
visorchannel_get_nbytes(VISORCHANNEL *channel)
visorchannel_get_nbytes(struct visorchannel *channel)
{
return channel->size;
}
@ -186,42 +187,42 @@ visorchannel_uuid_id(uuid_le *guid, char *s)
EXPORT_SYMBOL_GPL(visorchannel_uuid_id);
char *
visorchannel_id(VISORCHANNEL *channel, char *s)
visorchannel_id(struct visorchannel *channel, char *s)
{
return visorchannel_uuid_id(&channel->guid, s);
}
EXPORT_SYMBOL_GPL(visorchannel_id);
char *
visorchannel_zoneid(VISORCHANNEL *channel, char *s)
visorchannel_zoneid(struct visorchannel *channel, char *s)
{
return visorchannel_uuid_id(&channel->chan_hdr.zone_uuid, s);
}
EXPORT_SYMBOL_GPL(visorchannel_zoneid);
HOSTADDRESS
visorchannel_get_clientpartition(VISORCHANNEL *channel)
visorchannel_get_clientpartition(struct visorchannel *channel)
{
return channel->chan_hdr.partition_handle;
}
EXPORT_SYMBOL_GPL(visorchannel_get_clientpartition);
uuid_le
visorchannel_get_uuid(VISORCHANNEL *channel)
visorchannel_get_uuid(struct visorchannel *channel)
{
return channel->guid;
}
EXPORT_SYMBOL_GPL(visorchannel_get_uuid);
struct memregion *
visorchannel_get_memregion(VISORCHANNEL *channel)
visorchannel_get_memregion(struct visorchannel *channel)
{
return channel->memregion;
}
EXPORT_SYMBOL_GPL(visorchannel_get_memregion);
int
visorchannel_read(VISORCHANNEL *channel, ulong offset,
visorchannel_read(struct visorchannel *channel, ulong offset,
void *local, ulong nbytes)
{
int rc = visor_memregion_read(channel->memregion, offset,
@ -236,7 +237,7 @@ visorchannel_read(VISORCHANNEL *channel, ulong offset,
EXPORT_SYMBOL_GPL(visorchannel_read);
int
visorchannel_write(VISORCHANNEL *channel, ulong offset,
visorchannel_write(struct visorchannel *channel, ulong offset,
void *local, ulong nbytes)
{
if (offset == 0 && nbytes >= sizeof(struct channel_header))
@ -247,7 +248,8 @@ visorchannel_write(VISORCHANNEL *channel, ulong offset,
EXPORT_SYMBOL_GPL(visorchannel_write);
int
visorchannel_clear(VISORCHANNEL *channel, ulong offset, u8 ch, ulong nbytes)
visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch,
ulong nbytes)
{
int rc = -1;
int bufsize = 65536;
@ -286,7 +288,7 @@ cleanup:
EXPORT_SYMBOL_GPL(visorchannel_clear);
void __iomem *
visorchannel_get_header(VISORCHANNEL *channel)
visorchannel_get_header(struct visorchannel *channel)
{
return (void __iomem *)&channel->chan_hdr;
}
@ -317,7 +319,7 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header);
sizeof((sig_hdr)->FIELD)) >= 0)
static BOOL
sig_read_header(VISORCHANNEL *channel, u32 queue,
sig_read_header(struct visorchannel *channel, u32 queue,
struct signal_queue_header *sig_hdr)
{
BOOL rc = FALSE;
@ -345,7 +347,7 @@ cleanup:
}
static BOOL
sig_do_data(VISORCHANNEL *channel, u32 queue,
sig_do_data(struct visorchannel *channel, u32 queue,
struct signal_queue_header *sig_hdr, u32 slot, void *data,
BOOL is_write)
{
@ -374,14 +376,14 @@ cleanup:
}
static inline BOOL
sig_read_data(VISORCHANNEL *channel, u32 queue,
sig_read_data(struct visorchannel *channel, u32 queue,
struct signal_queue_header *sig_hdr, u32 slot, void *data)
{
return sig_do_data(channel, queue, sig_hdr, slot, data, FALSE);
}
static inline BOOL
sig_write_data(VISORCHANNEL *channel, u32 queue,
sig_write_data(struct visorchannel *channel, u32 queue,
struct signal_queue_header *sig_hdr, u32 slot, void *data)
{
return sig_do_data(channel, queue, sig_hdr, slot, data, TRUE);
@ -410,7 +412,7 @@ safe_sig_queue_validate(struct signal_queue_header *psafe_sqh,
} /* end safe_sig_queue_validate */
BOOL
visorchannel_signalremove(VISORCHANNEL *channel, u32 queue, void *msg)
visorchannel_signalremove(struct visorchannel *channel, u32 queue, void *msg)
{
BOOL rc = FALSE;
struct signal_queue_header sig_hdr;
@ -457,7 +459,7 @@ cleanup:
EXPORT_SYMBOL_GPL(visorchannel_signalremove);
BOOL
visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg)
visorchannel_signalinsert(struct visorchannel *channel, u32 queue, void *msg)
{
BOOL rc = FALSE;
struct signal_queue_header sig_hdr;
@ -512,7 +514,7 @@ cleanup:
EXPORT_SYMBOL_GPL(visorchannel_signalinsert);
int
visorchannel_signalqueue_slots_avail(VISORCHANNEL *channel, u32 queue)
visorchannel_signalqueue_slots_avail(struct visorchannel *channel, u32 queue)
{
struct signal_queue_header sig_hdr;
u32 slots_avail, slots_used;
@ -531,7 +533,7 @@ visorchannel_signalqueue_slots_avail(VISORCHANNEL *channel, u32 queue)
EXPORT_SYMBOL_GPL(visorchannel_signalqueue_slots_avail);
int
visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, u32 queue)
visorchannel_signalqueue_max_slots(struct visorchannel *channel, u32 queue)
{
struct signal_queue_header sig_hdr;
@ -566,7 +568,7 @@ sigqueue_debug(struct signal_queue_header *q, int which, struct seq_file *seq)
}
void
visorchannel_debug(VISORCHANNEL *channel, int num_queues,
visorchannel_debug(struct visorchannel *channel, int num_queues,
struct seq_file *seq, u32 off)
{
HOSTADDRESS addr = 0;
@ -648,7 +650,7 @@ visorchannel_debug(VISORCHANNEL *channel, int num_queues,
EXPORT_SYMBOL_GPL(visorchannel_debug);
void
visorchannel_dump_section(VISORCHANNEL *chan, char *s,
visorchannel_dump_section(struct visorchannel *chan, char *s,
int off, int len, struct seq_file *seq)
{
char *buf, *tbuf, *fmtbuf;

Просмотреть файл

@ -29,7 +29,7 @@
#define CURRENT_FILE_PC VISOR_CHIPSET_PC_file_c
static struct cdev file_cdev;
static VISORCHANNEL **file_controlvm_channel;
static struct visorchannel **file_controlvm_channel;
static dev_t majordev = -1; /**< indicates major num for device */
static BOOL registered = FALSE;
@ -48,7 +48,8 @@ static const struct file_operations visorchipset_fops = {
.mmap = visorchipset_mmap,
};
int visorchipset_file_init(dev_t major_dev, VISORCHANNEL **controlvm_channel)
int
visorchipset_file_init(dev_t major_dev, struct visorchannel **controlvm_channel)
{
int rc = 0;

Просмотреть файл

@ -20,7 +20,8 @@
#include "globals.h"
int visorchipset_file_init(dev_t major_dev, VISORCHANNEL **controlvm_channel);
int visorchipset_file_init(dev_t majorDev,
struct visorchannel **pControlVm_channel);
void visorchipset_file_cleanup(void);
#endif

Просмотреть файл

@ -101,7 +101,7 @@ static struct controlvm_message_packet g_DeviceChangeStatePacket;
static LIST_HEAD(BusInfoList);
static LIST_HEAD(DevInfoList);
static VISORCHANNEL *ControlVm_channel;
static struct visorchannel *ControlVm_channel;
typedef struct {
u8 __iomem *ptr; /* pointer to base address of payload pool */