From e0fed862c84dbd4b6fce1e6e525767b0a4b95c81 Mon Sep 17 00:00:00 2001 From: Benjamin Romer Date: Thu, 23 Oct 2014 14:30:03 -0400 Subject: [PATCH] staging: unisys: remove typedef SIGNAL_QUEUE_HEADER Get rid of the typedef for SIGNAL_QUEUE_HEADER and use struct signal_queue_header directly instead. Fix all references to the typedef to use the struct. Signed-off-by: Benjamin Romer Signed-off-by: Greg Kroah-Hartman --- drivers/staging/unisys/channels/channel.c | 16 ++++---- .../common-spar/include/channels/channel.h | 4 +- .../include/channels/controlvmchannel.h | 8 ++-- .../include/channels/diagchannel.h | 4 +- .../common-spar/include/channels/iochannel.h | 4 +- drivers/staging/unisys/include/uisqueue.h | 4 +- drivers/staging/unisys/virthba/virthba.c | 8 ++-- .../unisys/visorchannel/visorchannel_funcs.c | 41 ++++++++++--------- 8 files changed, 46 insertions(+), 43 deletions(-) diff --git a/drivers/staging/unisys/channels/channel.c b/drivers/staging/unisys/channels/channel.c index c2f95f33b114..d6db66181148 100644 --- a/drivers/staging/unisys/channels/channel.c +++ b/drivers/staging/unisys/channels/channel.c @@ -50,8 +50,8 @@ visor_signal_insert(struct channel_header __iomem *pChannel, u32 Queue, void __iomem *psignal; unsigned int head, tail, nof; - SIGNAL_QUEUE_HEADER __iomem *pqhdr = - (SIGNAL_QUEUE_HEADER __iomem *) + struct signal_queue_header __iomem *pqhdr = + (struct signal_queue_header __iomem *) ((char __iomem *) pChannel + readq(&pChannel->ch_space_offset)) + Queue; @@ -108,8 +108,8 @@ visor_signal_remove(struct channel_header __iomem *pChannel, u32 Queue, { void __iomem *psource; unsigned int head, tail; - SIGNAL_QUEUE_HEADER __iomem *pqhdr = - (SIGNAL_QUEUE_HEADER __iomem *) ((char __iomem *) pChannel + + struct signal_queue_header __iomem *pqhdr = + (struct signal_queue_header __iomem *) ((char __iomem *) pChannel + readq(&pChannel->ch_space_offset)) + Queue; /* capture current head and tail */ @@ -163,8 +163,8 @@ SignalRemoveAll(struct channel_header *pChannel, u32 Queue, void *pSignal) { void *psource; unsigned int head, tail, signalCount = 0; - pSIGNAL_QUEUE_HEADER pqhdr = - (pSIGNAL_QUEUE_HEADER) ((char *) pChannel + + struct signal_queue_header *pqhdr = + (struct signal_queue_header *) ((char *) pChannel + pChannel->ch_space_offset) + Queue; /* capture current head and tail */ @@ -212,8 +212,8 @@ SignalRemoveAll(struct channel_header *pChannel, u32 Queue, void *pSignal) unsigned char visor_signalqueue_empty(struct channel_header __iomem *pChannel, u32 Queue) { - SIGNAL_QUEUE_HEADER __iomem *pqhdr = - (SIGNAL_QUEUE_HEADER __iomem *) ((char __iomem *) pChannel + + struct signal_queue_header __iomem *pqhdr = + (struct signal_queue_header __iomem *) ((char __iomem *) pChannel + readq(&pChannel->ch_space_offset)) + Queue; return readl(&pqhdr->Head) == readl(&pqhdr->Tail); } diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h b/drivers/staging/unisys/common-spar/include/channels/channel.h index 84f64624bd63..3c4f7c058e53 100644 --- a/drivers/staging/unisys/common-spar/include/channels/channel.h +++ b/drivers/staging/unisys/common-spar/include/channels/channel.h @@ -232,7 +232,7 @@ struct channel_header { #define ULTRA_CHANNEL_ENABLE_INTS (0x1ULL << 0) /* Subheader for the Signal Type variation of the Common Channel */ -typedef struct _SIGNAL_QUEUE_HEADER { +struct signal_queue_header { /* 1st cache line */ u32 VersionId; /* SIGNAL_QUEUE_HEADER Version ID */ u32 Type; /* Queue type: storage, network */ @@ -265,7 +265,7 @@ typedef struct _SIGNAL_QUEUE_HEADER { * to denote trouble with client's * fields */ u8 Filler[12]; /* Pad out to 64 byte cacheline */ -} SIGNAL_QUEUE_HEADER, *pSIGNAL_QUEUE_HEADER; +}; #pragma pack(pop) diff --git a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h index 8e8a5a57bddb..91e75f4d3e21 100644 --- a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h +++ b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h @@ -542,16 +542,16 @@ typedef struct _ULTRA_CONTROLVM_CHANNEL_PROTOCOL { u32 SPReserved; u8 Reserved2[28]; /* Force signals to begin on 128-byte cache * line */ - SIGNAL_QUEUE_HEADER RequestQueue; /* Service or guest partition + struct signal_queue_header RequestQueue;/* Service or guest partition * uses this queue to send * requests to Control */ - SIGNAL_QUEUE_HEADER ResponseQueue; /* Control uses this queue to + struct signal_queue_header ResponseQueue;/* Control uses this queue to * respond to service or guest * partition requests */ - SIGNAL_QUEUE_HEADER EventQueue; /* Control uses this queue to + struct signal_queue_header EventQueue; /* Control uses this queue to * send events to service or * guest partition */ - SIGNAL_QUEUE_HEADER EventAckQueue; /* Service or guest partition + struct signal_queue_header EventAckQueue;/* Service or guest partition * uses this queue to ack * Control events */ diff --git a/drivers/staging/unisys/common-spar/include/channels/diagchannel.h b/drivers/staging/unisys/common-spar/include/channels/diagchannel.h index 590022fd9fb6..919f628360c2 100644 --- a/drivers/staging/unisys/common-spar/include/channels/diagchannel.h +++ b/drivers/staging/unisys/common-spar/include/channels/diagchannel.h @@ -384,7 +384,7 @@ typedef struct _DIAG_CHANNEL_PROTOCOL_HEADER { /* Offsets/sizes for diagnostic channel attributes... */ #define DIAG_CH_QUEUE_HEADER_OFFSET (sizeof(struct channel_header)) -#define DIAG_CH_QUEUE_HEADER_SIZE (sizeof(SIGNAL_QUEUE_HEADER)) +#define DIAG_CH_QUEUE_HEADER_SIZE (sizeof(struct signal_queue_header)) #define DIAG_CH_PROTOCOL_HEADER_OFFSET \ (DIAG_CH_QUEUE_HEADER_OFFSET + DIAG_CH_QUEUE_HEADER_SIZE) #define DIAG_CH_PROTOCOL_HEADER_SIZE (sizeof(DIAG_CHANNEL_PROTOCOL_HEADER)) @@ -417,7 +417,7 @@ typedef struct _DIAG_CHANNEL_PROTOCOL_HEADER { */ typedef struct _ULTRA_DIAG_CHANNEL_PROTOCOL { struct channel_header CommonChannelHeader; - SIGNAL_QUEUE_HEADER QueueHeader; + struct signal_queue_header QueueHeader; DIAG_CHANNEL_PROTOCOL_HEADER DiagChannelHeader; DIAG_CHANNEL_EVENT Events[(DIAG_CH_SIZE - DIAG_CH_EVENT_OFFSET) / sizeof(DIAG_CHANNEL_EVENT)]; diff --git a/drivers/staging/unisys/common-spar/include/channels/iochannel.h b/drivers/staging/unisys/common-spar/include/channels/iochannel.h index c26363de86dd..ac78d9c2585c 100644 --- a/drivers/staging/unisys/common-spar/include/channels/iochannel.h +++ b/drivers/staging/unisys/common-spar/include/channels/iochannel.h @@ -686,8 +686,8 @@ struct uiscmdrsp { * response queues as specified in cmdQ and rspQ SIGNAL_QUEUE_HEADERS. */ typedef struct _ULTRA_IO_CHANNEL_PROTOCOL { struct channel_header ChannelHeader; - SIGNAL_QUEUE_HEADER cmdQ; - SIGNAL_QUEUE_HEADER rspQ; + struct signal_queue_header cmdQ; + struct signal_queue_header rspQ; union { struct { struct vhba_wwnn wwnn; /* 8 bytes */ diff --git a/drivers/staging/unisys/include/uisqueue.h b/drivers/staging/unisys/include/uisqueue.h index 7d01c42abcb9..25b6181d78af 100644 --- a/drivers/staging/unisys/include/uisqueue.h +++ b/drivers/staging/unisys/include/uisqueue.h @@ -47,8 +47,8 @@ struct uisqueue_info { u64 non_empty_wakeup_cnt; struct { - SIGNAL_QUEUE_HEADER reserved1; /* */ - SIGNAL_QUEUE_HEADER reserved2; /* */ + struct signal_queue_header reserved1; /* */ + struct signal_queue_header reserved2; /* */ } safe_uis_queue; unsigned int (*send_int_if_needed)(struct uisqueue_info *info, unsigned int whichcqueue, diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index df0e89ccdc18..9d4653d34608 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -421,7 +421,7 @@ virthba_ISR(int irq, void *dev_id) { struct virthba_info *virthbainfo = (struct virthba_info *) dev_id; struct channel_header __iomem *pChannelHeader; - SIGNAL_QUEUE_HEADER __iomem *pqhdr; + struct signal_queue_header __iomem *pqhdr; u64 mask; unsigned long long rc1; @@ -442,7 +442,7 @@ virthba_ISR(int irq, void *dev_id) virthbainfo->interrupts_notme++; return IRQ_NONE; } - pqhdr = (SIGNAL_QUEUE_HEADER __iomem *) + pqhdr = (struct signal_queue_header __iomem *) ((char __iomem *) pChannelHeader + readq(&pChannelHeader->ch_space_offset)) + IOCHAN_FROM_IOPART; writeq(readq(&pqhdr->NumInterruptsReceived) + 1, @@ -462,7 +462,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id) int i; irq_handler_t handler = virthba_ISR; struct channel_header __iomem *pChannelHeader; - SIGNAL_QUEUE_HEADER __iomem *pqhdr; + struct signal_queue_header __iomem *pqhdr; u64 mask; LOGVER("entering virthba_probe...\n"); @@ -586,7 +586,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id) virthbainfo->chinfo.queueinfo, &virthbainfo->chinfo.threadinfo); pChannelHeader = virthbainfo->chinfo.queueinfo->chan; - pqhdr = (SIGNAL_QUEUE_HEADER __iomem *) + pqhdr = (struct signal_queue_header __iomem *) ((char __iomem *)pChannelHeader + readq(&pChannelHeader->ch_space_offset)) + IOCHAN_FROM_IOPART; virthbainfo->flags_addr = &pqhdr->FeatureFlags; diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 19f5c775ca88..7b30c66d3a3e 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -38,10 +38,10 @@ struct VISORCHANNEL_Tag { spinlock_t remove_lock; struct { - SIGNAL_QUEUE_HEADER req_queue; - SIGNAL_QUEUE_HEADER rsp_queue; - SIGNAL_QUEUE_HEADER event_queue; - SIGNAL_QUEUE_HEADER ack_queue; + struct signal_queue_header req_queue; + struct signal_queue_header rsp_queue; + struct signal_queue_header event_queue; + struct signal_queue_header ack_queue; } safe_uis_queue; }; @@ -295,7 +295,8 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header); * channel header */ #define SIG_QUEUE_OFFSET(chan_hdr, q) \ - ((chan_hdr)->ch_space_offset + ((q) * sizeof(SIGNAL_QUEUE_HEADER))) + ((chan_hdr)->ch_space_offset + \ + ((q) * sizeof(struct signal_queue_header))) /** Return offset of a specific queue entry (data) from the beginning of a * channel header @@ -310,13 +311,13 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header); #define SIG_WRITE_FIELD(channel, queue, sig_hdr, FIELD) \ (visor_memregion_write(channel->memregion, \ SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)+ \ - offsetof(SIGNAL_QUEUE_HEADER, FIELD), \ + offsetof(struct signal_queue_header, FIELD),\ &((sig_hdr)->FIELD), \ sizeof((sig_hdr)->FIELD)) >= 0) static BOOL sig_read_header(VISORCHANNEL *channel, u32 queue, - SIGNAL_QUEUE_HEADER *sig_hdr) + struct signal_queue_header *sig_hdr) { BOOL rc = FALSE; @@ -329,7 +330,8 @@ sig_read_header(VISORCHANNEL *channel, u32 queue, if (visor_memregion_read(channel->memregion, SIG_QUEUE_OFFSET(&channel->chan_hdr, queue), - sig_hdr, sizeof(SIGNAL_QUEUE_HEADER)) < 0) { + sig_hdr, + sizeof(struct signal_queue_header)) < 0) { ERRDRV("queue=%d SIG_QUEUE_OFFSET=%d", queue, (int)SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)); ERRDRV("visor_memregion_read of signal queue failed: (status=%d)\n", rc); @@ -342,7 +344,8 @@ Away: static BOOL sig_do_data(VISORCHANNEL *channel, u32 queue, - SIGNAL_QUEUE_HEADER *sig_hdr, u32 slot, void *data, BOOL is_write) + struct signal_queue_header *sig_hdr, u32 slot, void *data, + BOOL is_write) { BOOL rc = FALSE; int signal_data_offset = SIG_DATA_OFFSET(&channel->chan_hdr, queue, @@ -368,21 +371,21 @@ Away: static inline BOOL sig_read_data(VISORCHANNEL *channel, u32 queue, - SIGNAL_QUEUE_HEADER *sig_hdr, u32 slot, void *data) + 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, - SIGNAL_QUEUE_HEADER *sig_hdr, u32 slot, void *data) + struct signal_queue_header *sig_hdr, u32 slot, void *data) { return sig_do_data(channel, queue, sig_hdr, slot, data, TRUE); } static inline unsigned char -safe_sig_queue_validate(pSIGNAL_QUEUE_HEADER psafe_sqh, - pSIGNAL_QUEUE_HEADER punsafe_sqh, +safe_sig_queue_validate(struct signal_queue_header *psafe_sqh, + struct signal_queue_header *punsafe_sqh, u32 *phead, u32 *ptail) { if ((*phead >= psafe_sqh->MaxSignalSlots) @@ -406,7 +409,7 @@ BOOL visorchannel_signalremove(VISORCHANNEL *channel, u32 queue, void *msg) { BOOL rc = FALSE; - SIGNAL_QUEUE_HEADER sig_hdr; + struct signal_queue_header sig_hdr; if (channel->needs_lock) spin_lock(&channel->remove_lock); @@ -452,7 +455,7 @@ BOOL visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg) { BOOL rc = FALSE; - SIGNAL_QUEUE_HEADER sig_hdr; + struct signal_queue_header sig_hdr; if (channel->needs_lock) spin_lock(&channel->insert_lock); @@ -505,7 +508,7 @@ EXPORT_SYMBOL_GPL(visorchannel_signalinsert); int visorchannel_signalqueue_slots_avail(VISORCHANNEL *channel, u32 queue) { - SIGNAL_QUEUE_HEADER sig_hdr; + struct signal_queue_header sig_hdr; u32 slots_avail, slots_used; u32 head, tail; @@ -524,7 +527,7 @@ EXPORT_SYMBOL_GPL(visorchannel_signalqueue_slots_avail); int visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, u32 queue) { - SIGNAL_QUEUE_HEADER sig_hdr; + struct signal_queue_header sig_hdr; if (!sig_read_header(channel, queue, &sig_hdr)) return 0; @@ -533,7 +536,7 @@ visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, u32 queue) EXPORT_SYMBOL_GPL(visorchannel_signalqueue_max_slots); static void -sigqueue_debug(SIGNAL_QUEUE_HEADER *q, int which, struct seq_file *seq) +sigqueue_debug(struct signal_queue_header *q, int which, struct seq_file *seq) { seq_printf(seq, "Signal Queue #%d\n", which); seq_printf(seq, " VersionId = %lu\n", (ulong) q->VersionId); @@ -617,7 +620,7 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, ; else for (i = 0; i < nQueues; i++) { - SIGNAL_QUEUE_HEADER q; + struct signal_queue_header q; errcode = visorchannel_read(channel, off + phdr->ch_space_offset + -- 2.30.2