[PATCH] staging: unisys: virtpci: Remove GET_BUS_DEV macro
The GET_BUS_DEV macro contained flow control statements that are undesirable. This patch removes the macro and places the code in each function. Signed-off-by: Bryan Thompson --- drivers/staging/unisys/virtpci/virtpci.c | 48 -- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index e212c7a..39b828d 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -303,17 +303,6 @@ static int add_vbus(struct add_vbus_guestpart *addparams) sizeof(struct vhba_config_max)); \ } -/* find bus device with the busid that matches - match_busid matches bus_id */ -#define GET_BUS_DEV(busno) { \ - sprintf(busid, "vbus%d", busno); \ - vbus = bus_find_device(&virtpci_bus_type, NULL, \ - (void *)busid, match_busid); \ - if (!vbus) { \ - LOGERR(" FAILED to find vbus %s\n", busid); \ - return 0; \ - } \ -} - /* adds a vhba * returns 0 failure, 1 success, */ @@ -334,7 +323,14 @@ static int add_vhba(struct add_virt_guestpart *addparams) GET_SCSIADAPINFO_FROM_CHANPTR(addparams->chanptr); - GET_BUS_DEV(addparams->bus_no); + /* find bus device with the busid that matches match_busid */ + sprintf(busid, "vbus%d", addparams->bus_no); + vbus = bus_find_device(&virtpci_bus_type, NULL, + (void *)busid, match_busid); + if (!vbus) { + LOGERR(" FAILED to find vbus %s\n", busid); + return 0; + } LOGINF("Adding vhba wwnn:%x:%x config:%d-%d-%d-%d chanptr:%p\n", scsi.wwnn.wwnn1, scsi.wwnn.wwnn2, @@ -390,7 +386,14 @@ add_vnic(struct add_virt_guestpart *addparams) GET_NETADAPINFO_FROM_CHANPTR(addparams->chanptr); - GET_BUS_DEV(addparams->bus_no); + /* find bus device with the busid that matches match_busid */ + sprintf(busid, "vbus%d", addparams->bus_no); + vbus = bus_find_device(&virtpci_bus_type, NULL, + (void *)busid, match_busid); + if (!vbus) { + LOGERR(" FAILED to find vbus %s\n", busid); + return 0; + } LOGINF("Adding vnic macaddr:%02x:%02x:%02x:%02x:%02x:%02x rcvbufs:%d mtu:%d chanptr:%p%pUL\n", net.mac_addr[0], net.mac_addr[1], net.mac_addr[2], @@ -417,7 +420,15 @@ delete_vbus(struct del_vbus_guestpart *delparams) struct device *vbus; unsigned char busid[BUS_ID_SIZE]; - GET_BUS_DEV(delparams->bus_no); + /* find bus device with the busid that matches match_busid */ + sprintf(busid, "vbus%d", delparams->bus_no); + vbus = bus_find_device(&virtpci_bus_type, NULL, + (void *)busid, match_busid); + if (!vbus) { + LOGERR(" FAILED to find vbus %s\n", busid); + return 0; + } + /* ensure that bus has no devices? -- TBD */ LOGINF("Deleting %s\n", BUS_ID(vbus)); if (delete_vbus_device(vbus, NULL)) @@ -621,7 +632,14 @@ static int delete_all_virt(enum virtpci_dev_type devtype, unsigned char busid[BUS_ID_SIZE]; struct device *vbus; - GET_BUS_DEV(delparams->bus_no); + /* find bus device with the busid that matches match_busid */ + sprintf(busid, "vbus%d", delparams->bus_no); + vbus = bus_find_device(&virtpci_bus_type, NULL, + (void *)busid, match_busid); + if (!vbus) { + LOGERR(" FAILED to find vbus %s\n", busid); + return 0; + } if ((devtype != VIRTHBA_TYPE) && (devtype != VIRTNIC_TYPE)) { LOGERR(" FAILED to delete all devices; devtype:%d not vhba:%d or vnic:%d\n", -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/8] staging: unisys: visorchannel: Remove multiple blank lines
Remove the instances of multiple blank lines in the visorchannel files. Signed-off-by: Bryan Thompson --- drivers/staging/unisys/visorchannel/globals.h |1 - .../unisys/visorchannel/visorchannel_funcs.c |1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/globals.h b/drivers/staging/unisys/visorchannel/globals.h index 07653b8..581ed83 100644 --- a/drivers/staging/unisys/visorchannel/globals.h +++ b/drivers/staging/unisys/visorchannel/globals.h @@ -25,5 +25,4 @@ #define MYDRVNAME "visorchannel" - #endif diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 5fbd5ad..715aff8 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -504,7 +504,6 @@ Away: } EXPORT_SYMBOL_GPL(visorchannel_signalinsert); - int visorchannel_signalqueue_slots_avail(VISORCHANNEL *channel, u32 queue) { -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/8] staging: unisys: visorchannel: Remove unnecessary parentheses
Remove extraneous parentheses around a variable in visorchannel_funcs.c Signed-off-by: Bryan Thompson --- .../unisys/visorchannel/visorchannel_funcs.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index eb5934e..e121808 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -287,7 +287,7 @@ EXPORT_SYMBOL_GPL(visorchannel_clear); void __iomem * visorchannel_get_header(VISORCHANNEL *channel) { - return (void __iomem *)&(channel->chan_hdr); + return (void __iomem *)&channel->chan_hdr; } EXPORT_SYMBOL_GPL(visorchannel_get_header); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 8/8] staging: unisys: visorchannel: Add braces to else arm of if/else statement
Add braces to the else arm of an if/else block in visorchannel_funcs.c Signed-off-by: Bryan Thompson --- .../unisys/visorchannel/visorchannel_funcs.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index c3ac641..08dd78a 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -596,8 +596,9 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, if (off == 0) { phdr = &channel->chan_hdr; seq_puts(seq, "(following data may be stale)\n"); - } else + } else { return; + } } nbytes = (ulong)(phdr->size); seq_printf(seq, "--- Begin channel @0x%-16.16Lx for 0x%lx bytes (region=0x%lx bytes) ---\n", -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/8] staging: unisys: visorchannel: Adjust lines to contain a maximum of 80 characters
Split multiple logging lines to get them closer to 80 characters per line. Signed-off-by: Bryan Thompson --- .../unisys/visorchannel/visorchannel_funcs.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 96a8e70..a7f4ded 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -334,7 +334,8 @@ sig_read_header(VISORCHANNEL *channel, u32 queue, 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); + ERRDRV("visor_memregion_read of signal queue failed: (status=%d)\n", + rc); goto Away; } rc = TRUE; @@ -354,13 +355,15 @@ sig_do_data(VISORCHANNEL *channel, u32 queue, if (visor_memregion_write(channel->memregion, signal_data_offset, data, sig_hdr->signal_size) < 0) { - ERRDRV("visor_memregion_write of signal data failed: (status=%d)\n", rc); + ERRDRV("visor_memregion_write of signal data failed: (status=%d)\n", + rc); goto Away; } } else { if (visor_memregion_read(channel->memregion, signal_data_offset, data, sig_hdr->signal_size) < 0) { - ERRDRV("visor_memregion_read of signal data failed: (status=%d)\n", rc); + ERRDRV("visor_memregion_read of signal data failed: (status=%d)\n", + rc); goto Away; } } @@ -439,7 +442,8 @@ visorchannel_signalremove(VISORCHANNEL *channel, u32 queue, void *msg) goto Away; } if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_received)) { - ERRDRV("visor_memregion_write of NumSignalsReceived failed: (status=%d)\n", rc); + ERRDRV("visor_memregion_write of NumSignalsReceived failed: (status=%d)\n", + rc); goto Away; } rc = TRUE; @@ -469,7 +473,8 @@ visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg) if (sig_hdr.head == sig_hdr.tail) { sig_hdr.num_overflows++; if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_overflows)) { - ERRDRV("visor_memregion_write of NumOverflows failed: (status=%d)\n", rc); + ERRDRV("visor_memregion_write of NumOverflows failed: (status=%d)\n", + rc); goto Away; } rc = FALSE; @@ -492,7 +497,8 @@ visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg) goto Away; } if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_sent)) { - ERRDRV("visor_memregion_write of NumSignalsSent failed: (status=%d)\n", rc); + ERRDRV("visor_memregion_write of NumSignalsSent failed: (status=%d)\n", + rc); goto Away; } rc = TRUE; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/8] staging: unisys: visorchannel: Fix alignment issues
Use the appropriate whitespace for multiline statements in visorchannel_funcs.c Signed-off-by: Bryan Thompson --- .../unisys/visorchannel/visorchannel_funcs.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 715aff8..13dc82e 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -226,7 +226,7 @@ visorchannel_read(VISORCHANNEL *channel, ulong offset, int rc = visor_memregion_read(channel->memregion, offset, local, nbytes); if ((rc >= 0) && (offset == 0) && - (nbytes >= sizeof(struct channel_header))) { + (nbytes >= sizeof(struct channel_header))) { memcpy(&channel->chan_hdr, local, sizeof(struct channel_header)); } @@ -399,7 +399,7 @@ safe_sig_queue_validate(struct signal_queue_header *psafe_sqh, punsafe_sqh->tail = *ptail; ERRDRV("safe_sig_queue_validate: head = 0x%x, tail = 0x%x, MaxSlots = 0x%x", -*phead, *ptail, psafe_sqh->max_slots); + *phead, *ptail, psafe_sqh->max_slots); return 0; } return 1; @@ -622,9 +622,10 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, struct signal_queue_header q; errcode = visorchannel_read(channel, - off + phdr->ch_space_offset + - (i * sizeof(q)), - &q, sizeof(q)); + off + + phdr->ch_space_offset + + (i * sizeof(q)), + &q, sizeof(q)); if (errcode < 0) { seq_printf(seq, "failed to read signal queue #%d from channel @0x%-16.16Lx errcode=%d\n", -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/8] staging: unisys: visorchannel: Place logical continuation at the end of a line
Move the || logical continuation from the start of the second line of an if statement to the end of the first line. Signed-off-by: Bryan Thompson --- .../unisys/visorchannel/visorchannel_funcs.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index e121808..96a8e70 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -388,8 +388,8 @@ safe_sig_queue_validate(struct signal_queue_header *psafe_sqh, struct signal_queue_header *punsafe_sqh, u32 *phead, u32 *ptail) { - if ((*phead >= psafe_sqh->max_slots) - || (*ptail >= psafe_sqh->max_slots)) { + if ((*phead >= psafe_sqh->max_slots) || + (*ptail >= psafe_sqh->max_slots)) { /* Choose 0 or max, maybe based on current tail value */ *phead = 0; *ptail = 0; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/8] staging: unisys: visorchannel: Formatting cleanup of visorchannel
This series of patches address a collection of formatting issues reported by checkpatch.pl on the files in the visorchannel directory. Bryan Thompson (8): staging: unisys: visorchannel: Remove multiple blank lines staging: unisys: visorchannel: Fix alignment issues staging: unisys: visorchannel: Remove space between cast and variable staging: unisys: visorchannel: Remove unnecessary parentheses staging: unisys: visorchannel: Place logical continuation at the end of a line staging: unisys: visorchannel: Adjust lines to contain a maximum of 80 characters staging: unisys: visorchannel: Rename goto label Away staging: unisys: visorchannel: Add braces to else arm of if/else statement drivers/staging/unisys/visorchannel/globals.h |1 - .../unisys/visorchannel/visorchannel_funcs.c | 113 +++- 2 files changed, 60 insertions(+), 54 deletions(-) -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 7/8] staging: unisys: visorchannel: Rename goto label Away
Rename the goto label used throughout visorchannel_funcs.c from Away to cleanup. Signed-off-by: Bryan Thompson --- .../unisys/visorchannel/visorchannel_funcs.c | 54 ++-- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index a7f4ded..c3ac641 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -60,7 +60,7 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes, if (p == NULL) { ERRDRV("allocation failed: (status=0)\n"); rc = NULL; - goto Away; + goto cleanup; } p->memregion = NULL; p->needs_lock = needs_lock; @@ -79,13 +79,13 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes, if (p->memregion == NULL) { ERRDRV("visor_memregion_create failed failed: (status=0)\n"); rc = NULL; - goto Away; + goto cleanup; } if (visor_memregion_read(p->memregion, 0, &p->chan_hdr, sizeof(struct channel_header)) < 0) { ERRDRV("visor_memregion_read failed: (status=0)\n"); rc = NULL; - goto Away; + goto cleanup; } if (channelBytes == 0) /* we had better be a CLIENT of this channel */ @@ -96,13 +96,13 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes, if (visor_memregion_resize(p->memregion, channelBytes) < 0) { ERRDRV("visor_memregion_resize failed: (status=0)\n"); rc = NULL; - goto Away; + goto cleanup; } p->size = channelBytes; p->guid = guid; rc = p; -Away: +cleanup: if (rc == NULL) { if (p != NULL) { @@ -255,7 +255,7 @@ visorchannel_clear(VISORCHANNEL *channel, ulong offset, u8 ch, ulong nbytes) if (buf == NULL) { ERRDRV("%s failed memory allocation", __func__); - goto Away; + goto cleanup; } memset(buf, ch, bufsize); while (nbytes > 0) { @@ -268,14 +268,14 @@ visorchannel_clear(VISORCHANNEL *channel, ulong offset, u8 ch, ulong nbytes) buf, thisbytes); if (x < 0) { rc = x; - goto Away; + goto cleanup; } written += thisbytes; nbytes -= thisbytes; } rc = 0; -Away: +cleanup: if (buf != NULL) { vfree(buf); buf = NULL; @@ -323,7 +323,7 @@ sig_read_header(VISORCHANNEL *channel, u32 queue, if (channel->chan_hdr.ch_space_offset < sizeof(struct channel_header)) { ERRDRV("oChannelSpace too small: (status=%d)\n", rc); - goto Away; + goto cleanup; } /* Read the appropriate SIGNAL_QUEUE_HEADER into local memory. */ @@ -336,10 +336,10 @@ sig_read_header(VISORCHANNEL *channel, u32 queue, queue, (int)SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)); ERRDRV("visor_memregion_read of signal queue failed: (status=%d)\n", rc); - goto Away; + goto cleanup; } rc = TRUE; -Away: +cleanup: return rc; } @@ -357,18 +357,18 @@ sig_do_data(VISORCHANNEL *channel, u32 queue, data, sig_hdr->signal_size) < 0) { ERRDRV("visor_memregion_write of signal data failed: (status=%d)\n", rc); - goto Away; + goto cleanup; } } else { if (visor_memregion_read(channel->memregion, signal_data_offset, data, sig_hdr->signal_size) < 0) { ERRDRV("visor_memregion_read of signal data failed: (status=%d)\n", rc); - goto Away; + goto cleanup; } } rc = TRUE; -Away: +cleanup: return rc; } @@ -419,16 +419,16 @@ visorchannel_signalremove(VISORCHANNEL *channel, u32 queue, void *msg) if (!sig_read_header(channel, queue, &sig_hdr)) { rc = FALSE; - goto Away; + goto cleanup; } if (sig_hdr.head == sig_hdr.tail) { rc = FALSE; /* no signals to remove */ - got
[PATCH 3/8] staging: unisys: visorchannel: Remove space between cast and variable
Remove the whitespace between a cast and the variable in visorchannel_funcs.c Signed-off-by: Bryan Thompson --- .../unisys/visorchannel/visorchannel_funcs.c | 22 ++-- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 13dc82e..eb5934e 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -89,7 +89,7 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes, } if (channelBytes == 0) /* we had better be a CLIENT of this channel */ - channelBytes = (ulong) p->chan_hdr.size; + channelBytes = (ulong)p->chan_hdr.size; if (uuid_le_cmp(guid, NULL_UUID_LE) == 0) /* we had better be a CLIENT of this channel */ guid = p->chan_hdr.chtype; @@ -287,7 +287,7 @@ EXPORT_SYMBOL_GPL(visorchannel_clear); void __iomem * visorchannel_get_header(VISORCHANNEL *channel) { - return (void __iomem *) &(channel->chan_hdr); + return (void __iomem *)&(channel->chan_hdr); } EXPORT_SYMBOL_GPL(visorchannel_get_header); @@ -519,7 +519,7 @@ visorchannel_signalqueue_slots_avail(VISORCHANNEL *channel, u32 queue) head = head + sig_hdr.max_slots; slots_used = (head - tail); slots_avail = sig_hdr.max_signals - slots_used; - return (int) slots_avail; + return (int)slots_avail; } EXPORT_SYMBOL_GPL(visorchannel_signalqueue_slots_avail); @@ -530,7 +530,7 @@ visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, u32 queue) if (!sig_read_header(channel, queue, &sig_hdr)) return 0; - return (int) sig_hdr.max_signals; + return (int)sig_hdr.max_signals; } EXPORT_SYMBOL_GPL(visorchannel_signalqueue_max_slots); @@ -593,13 +593,13 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, } else return; } - nbytes = (ulong) (phdr->size); + nbytes = (ulong)(phdr->size); seq_printf(seq, "--- Begin channel @0x%-16.16Lx for 0x%lx bytes (region=0x%lx bytes) ---\n", addr + off, nbytes, nbytes_region); seq_printf(seq, "Type= %pUL\n", &phdr->chtype); seq_printf(seq, "ZoneGuid= %pUL\n", &phdr->zone_uuid); seq_printf(seq, "Signature = 0x%-16.16Lx\n", - (long long) phdr->signature); + (long long)phdr->signature); seq_printf(seq, "LegacyState = %lu\n", (ulong)phdr->legacy_state); seq_printf(seq, "SrvState= %lu\n", (ulong)phdr->srv_state); seq_printf(seq, "CliStateBoot= %lu\n", (ulong)phdr->cli_state_boot); @@ -607,14 +607,14 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, seq_printf(seq, "HeaderSize = %lu\n", (ulong)phdr->header_size); seq_printf(seq, "Size= %llu\n", (long long)phdr->size); seq_printf(seq, "Features= 0x%-16.16llx\n", - (long long) phdr->features); + (long long)phdr->features); seq_printf(seq, "PartitionHandle = 0x%-16.16llx\n", - (long long) phdr->partition_handle); + (long long)phdr->partition_handle); seq_printf(seq, "Handle = 0x%-16.16llx\n", - (long long) phdr->handle); - seq_printf(seq, "VersionId = %lu\n", (ulong) phdr->version_id); + (long long)phdr->handle); + seq_printf(seq, "VersionId = %lu\n", (ulong)phdr->version_id); seq_printf(seq, "oChannelSpace = %llu\n", - (long long) phdr->ch_space_offset); + (long long)phdr->ch_space_offset); if ((phdr->ch_space_offset == 0) || (errcode < 0)) ; else -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: unisys: visorchannel: Rename CamelCase variable nQueues
Rename the visorchannel_debug parameter nQueues to num_queues. Signed-off-by: Bryan Thompson --- drivers/staging/unisys/visorchannel/visorchannel.h |2 +- .../unisys/visorchannel/visorchannel_funcs.c |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h b/drivers/staging/unisys/visorchannel/visorchannel.h index 5dbfddb..3f2184c 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel.h +++ b/drivers/staging/unisys/visorchannel/visorchannel.h @@ -68,7 +68,7 @@ u64 visorchannel_get_clientpartition(VISORCHANNEL *channel); uuid_le visorchannel_get_uuid(VISORCHANNEL *channel); struct memregion *visorchannel_get_memregion(VISORCHANNEL *channel); char *visorchannel_uuid_id(uuid_le *guid, char *s); -void visorchannel_debug(VISORCHANNEL *channel, int nQueues, +void visorchannel_debug(VISORCHANNEL *channel, int num_queues, struct seq_file *seq, u32 off); void visorchannel_dump_section(VISORCHANNEL *chan, char *s, int off, int len, struct seq_file *seq); diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 6601b3e..1568b95 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -565,7 +565,7 @@ sigqueue_debug(struct signal_queue_header *q, int which, struct seq_file *seq) } void -visorchannel_debug(VISORCHANNEL *channel, int nQueues, +visorchannel_debug(VISORCHANNEL *channel, int num_queues, struct seq_file *seq, u32 off) { HOSTADDRESS addr = 0; @@ -625,7 +625,7 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, if ((phdr->ch_space_offset == 0) || (errcode < 0)) ; else - for (i = 0; i < nQueues; i++) { + for (i = 0; i < num_queues; i++) { struct signal_queue_header q; errcode = visorchannel_read(channel, -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] staging: unisys: visorchannel: Describe spinlocks in VISORCHANNEL_Tag struct
Add comments indicating the requirements and use of the insert_lock and remove_lock in the VISORCHANNEL_Tag structure. Signed-off-by: Bryan Thompson --- .../unisys/visorchannel/visorchannel_funcs.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 1568b95..1ce25c2 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -33,9 +33,10 @@ struct VISORCHANNEL_Tag { struct channel_header chan_hdr; uuid_le guid; ulong size; - BOOL needs_lock; - spinlock_t insert_lock; - spinlock_t remove_lock; + BOOL needs_lock;/* channel creator knows if more than one +* thread will be inserting or removing */ + spinlock_t insert_lock; /* protect head writes in chan_hdr */ + spinlock_t remove_lock; /* protect tail writes in chan_hdr */ struct { struct signal_queue_header req_queue; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/4] staging: unisys: visorchannel: CamelCase and comment cleanup
Resending due to return address error. This series of patches addresses two CamelCase issues and a spinlock commenting issue reported by checkpatch on the visorchannel tree. Bryan Thompson (3): staging: unisys: visorchannel: Rename CamelCase variable channelBytes staging: unisys: visorchannel: Rename CamelCase variable nQueues staging: unisys: visorchannel: Describe spinlocks in VISORCHANNEL_Tag struct drivers/staging/unisys/visorchannel/visorchannel.h | 12 +++ .../unisys/visorchannel/visorchannel_funcs.c | 37 ++-- 2 files changed, 25 insertions(+), 24 deletions(-) -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: unisys: visorchannel: Rename CamelCase variable channelBytes
Rename channelBytes to channel_bytes in the series of visorchannel_create functions provided by visorchannel. Signed-off-by: Bryan Thompson --- drivers/staging/unisys/visorchannel/visorchannel.h | 10 .../unisys/visorchannel/visorchannel_funcs.c | 26 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h b/drivers/staging/unisys/visorchannel/visorchannel.h index 5061edf..5dbfddb 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel.h +++ b/drivers/staging/unisys/visorchannel/visorchannel.h @@ -35,17 +35,17 @@ typedef struct VISORCHANNEL_Tag VISORCHANNEL; /* Note that for visorchannel_create() and visorchannel_create_overlapped(), - * and arguments may be 0 if we are a channel CLIENT. + * and 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 channelBytes, uuid_le guid); -VISORCHANNEL *visorchannel_create_overlapped(ulong channelBytes, + 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 channelBytes, uuid_le guid); -VISORCHANNEL *visorchannel_create_overlapped_with_lock(ulong channelBytes, + 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); diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 36559d5..6601b3e 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -49,7 +49,7 @@ struct VISORCHANNEL_Tag { * NOT modify this data area. */ static VISORCHANNEL * -visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes, +visorchannel_create_guts(HOSTADDRESS physaddr, ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid, BOOL needs_lock) { @@ -87,18 +87,18 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes, rc = NULL; goto cleanup; } - if (channelBytes == 0) + if (channel_bytes == 0) /* we had better be a CLIENT of this channel */ - channelBytes = (ulong)p->chan_hdr.size; + channel_bytes = (ulong)p->chan_hdr.size; if (uuid_le_cmp(guid, NULL_UUID_LE) == 0) /* we had better be a CLIENT of this channel */ guid = p->chan_hdr.chtype; - if (visor_memregion_resize(p->memregion, channelBytes) < 0) { + if (visor_memregion_resize(p->memregion, channel_bytes) < 0) { ERRDRV("visor_memregion_resize failed: (status=0)\n"); rc = NULL; goto cleanup; } - p->size = channelBytes; + p->size = channel_bytes; p->guid = guid; rc = p; @@ -114,37 +114,37 @@ cleanup: } VISORCHANNEL * -visorchannel_create(HOSTADDRESS physaddr, ulong channelBytes, uuid_le guid) +visorchannel_create(HOSTADDRESS physaddr, ulong channel_bytes, uuid_le guid) { - return visorchannel_create_guts(physaddr, channelBytes, NULL, 0, guid, + return visorchannel_create_guts(physaddr, channel_bytes, NULL, 0, guid, FALSE); } EXPORT_SYMBOL_GPL(visorchannel_create); VISORCHANNEL * -visorchannel_create_with_lock(HOSTADDRESS physaddr, ulong channelBytes, +visorchannel_create_with_lock(HOSTADDRESS physaddr, ulong channel_bytes, uuid_le guid) { - return visorchannel_create_guts(physaddr, channelBytes, NULL, 0, guid, + return visorchannel_create_guts(physaddr, channel_bytes, NULL, 0, guid, TRUE); } EXPORT_SYMBOL_GPL(visorchannel_create_with_lock); VISORCHANNEL * -visorchannel_create_overlapped(ulong channelBytes, +visorchannel_create_overlapped(ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid) { - return visorchannel_create_guts(0, channelBytes, parent, off, guid, + return visorchannel_create_guts(0, channel_bytes, parent, off, guid, FALSE); } EXPORT_SYMBOL_GPL(visorcha
[PATCH 7/9] staging: unisys: virtpci: Use a single blank line to separate code blocks
Remove one blank line of two between function variable declaration and implementation in virt_pci_mod_init(). Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virtpci/virtpci.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 07d1966..f13daab 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -1502,7 +1502,6 @@ static int __init virtpci_mod_init(void) { int ret; - if (!unisys_spar_platform) return -ENODEV; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 8/9] staging: unisys: virtpci: Fix alignment issues
Use the appropriate whitespace alignment for multiline statements in virtpci.c Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virtpci/virtpci.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index f13daab..928f0fd 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -110,7 +110,7 @@ static int virtpci_device_probe(struct device *dev); static int virtpci_device_remove(struct device *dev); static ssize_t info_debugfs_read(struct file *file, char __user *buf, - size_t len, loff_t *offset); +size_t len, loff_t *offset); static const struct file_operations debugfs_info_fops = { .read = info_debugfs_read, @@ -392,9 +392,9 @@ add_vnic(struct add_virt_guestpart *addparams) GET_BUS_DEV(addparams->bus_no); LOGINF("Adding vnic macaddr:%02x:%02x:%02x:%02x:%02x:%02x rcvbufs:%d mtu:%d chanptr:%p%pUL\n", -net.mac_addr[0], net.mac_addr[1], net.mac_addr[2], net.mac_addr[3], -net.mac_addr[4], net.mac_addr[5], net.num_rcv_bufs, net.mtu, -addparams->chanptr, &net.zone_uuid); + net.mac_addr[0], net.mac_addr[1], net.mac_addr[2], + net.mac_addr[3], net.mac_addr[4], net.mac_addr[5], + net.num_rcv_bufs, net.mtu, addparams->chanptr, &net.zone_uuid); i = virtpci_device_add(vbus, VIRTNIC_TYPE, addparams, NULL, &net); if (i) { LOGINF("Added vnic macaddr:%02x:%02x:%02x:%02x:%02x:%02x\n", @@ -624,7 +624,7 @@ static int delete_all_virt(enum virtpci_dev_type devtype, if ((devtype != VIRTHBA_TYPE) && (devtype != VIRTNIC_TYPE)) { LOGERR(" FAILED to delete all devices; devtype:%d not vhba:%d or vnic:%d\n", -devtype, VIRTHBA_TYPE, VIRTNIC_TYPE); + devtype, VIRTHBA_TYPE, VIRTNIC_TYPE); return 0; } @@ -694,7 +694,7 @@ virtpci_match_device(const struct pci_device_id *ids, { while (ids->vendor || ids->subvendor || ids->class_mask) { DBGINF("ids->vendor:%x dev->vendor:%x ids->device:%x dev->device:%x\n", -ids->vendor, dev->vendor, ids->device, dev->device); + ids->vendor, dev->vendor, ids->device, dev->device); if ((ids->vendor == dev->vendor) && (ids->device == dev->device)) @@ -793,9 +793,9 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, int devType, break; } bus_device_info_init(&devInfo, stype, - virtpcidrv->name, - virtpcidrv->version, - virtpcidrv->vertag); +virtpcidrv->name, +virtpcidrv->version, +virtpcidrv->vertag); write_vbus_devInfo(pChan, &devInfo, devNo); /* Re-write bus+chipset info, because it is possible that this @@ -916,7 +916,7 @@ static int virtpci_device_add(struct device *parentbus, int devtype, if ((devtype != VIRTHBA_TYPE) && (devtype != VIRTNIC_TYPE)) { LOGERR(" FAILED to add device; devtype:%d not vhba:%d or vnic:%d\n", -devtype, VIRTHBA_TYPE, VIRTNIC_TYPE); + devtype, VIRTHBA_TYPE, VIRTNIC_TYPE); POSTCODE_LINUX_3(VPCI_CREATE_FAILURE_PC, devtype, POSTCODE_SEVERITY_ERR); return 0; @@ -1427,7 +1427,7 @@ static int print_vbus(struct device *vbus, void *data) } static ssize_t info_debugfs_read(struct file *file, char __user *buf, - size_t len, loff_t *offset) +size_t len, loff_t *offset) { ssize_t bytes_read = 0; int str_pos = 0; @@ -1519,7 +1519,7 @@ static int __init virtpci_mod_init(void) } DBGINF("bus_register successful\n"); bus_device_info_init(&Bus_DriverInfo, "clientbus", "virtpci", - VERSION, NULL); +VERSION, NULL); /* create a root bus used to parent all the virtpci buses. */ ret = device_register(&virtpci_rootbus_device); @@ -1542,11 +1542,11 @@ static int __init virtpci_mod_init(void) } LOGINF("successfully registered virtpci_ctrlchan_func (0x%p) as callback.\n", -(void *)&virtpci_ctrlchan_func); + (void *)&virtpci_ctrlchan_func); /* create debugfs directory and inf
[PATCH 1/9] staging: unisys: virtpci: Add a blank line after the definition of driver_private
Insert a blank line between the definition of the driver_private structure and the next statement. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virtpci/virtpci.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 52ec69f..1f72103 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -50,6 +50,7 @@ struct driver_private { struct module_kobject *mkobj; struct device_driver *driver; }; + #define to_driver(obj) container_of(obj, struct driver_private, kobj) /* bus_id went away in 2.6.30 - the size was 20 bytes, so we'll define -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/9] staging: unisys: virtpci: Allocate memory using the size of the variable
Change two instances of using the sizeof a structure to the size of a specific variable when allocating memory in virtpci.c Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virtpci/virtpci.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 560639a..3cfa767 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -256,7 +256,7 @@ static int add_vbus(struct add_vbus_guestpart *addparams) int ret; struct device *vbus; - vbus = kzalloc(sizeof(struct device), GFP_ATOMIC); + vbus = kzalloc(sizeof(*vbus), GFP_ATOMIC); POSTCODE_LINUX_2(VPCI_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO); if (!vbus) @@ -922,7 +922,7 @@ static int virtpci_device_add(struct device *parentbus, int devtype, } /* add a Virtual Device */ - virtpcidev = kzalloc(sizeof(struct virtpci_dev), GFP_ATOMIC); + virtpcidev = kzalloc(sizeof(*virtpcidev), GFP_ATOMIC); if (virtpcidev == NULL) { LOGERR("can't add device - malloc FALLED\n"); POSTCODE_LINUX_2(MALLOC_FAILURE_PC, POSTCODE_SEVERITY_ERR); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/9] staging: unisys: virtpci: Place logical continuation at the end of a line
Move the && logical continuation from the start of the second line of an if statement to the end of the first line. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virtpci/virtpci.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 3cfa767..baf12e5 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -696,8 +696,8 @@ virtpci_match_device(const struct pci_device_id *ids, DBGINF("ids->vendor:%x dev->vendor:%x ids->device:%x dev->device:%x\n", ids->vendor, dev->vendor, ids->device, dev->device); - if ((ids->vendor == dev->vendor) - && (ids->device == dev->device)) + if ((ids->vendor == dev->vendor) && + (ids->device == dev->device)) return ids; ids++; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 9/9] staging: unisys: virtpci: Adjust lines to contain a maximum of 80 characters
Update delete_all_virt function definition to two lines so each line is less than 80 characters long. Move comments on virtpci_device_add function parameters to a header block to contain each line to 80 characters. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virtpci/virtpci.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 928f0fd..b6c3130 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -897,10 +897,13 @@ static void virtpci_bus_release(struct device *dev) /* Adapter functions */ /*/ +/* scsi is expected to be NULL for VNIC add + * net is expected to be NULL for VHBA add + */ static int virtpci_device_add(struct device *parentbus, int devtype, struct add_virt_guestpart *addparams, - struct scsi_adap_info *scsi, /* NULL for VNIC add */ - struct net_adap_info *net /* NULL for VHBA add */) + struct scsi_adap_info *scsi, + struct net_adap_info *net) { struct virtpci_dev *virtpcidev = NULL; struct virtpci_dev *tmpvpcidev = NULL, *prev; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/9] staging: unisys: virtpci: Remove extraneous blank lines
Removed unnecessary blank lines from virtpci.c Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virtpci/virtpci.c |3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 1f72103..7b00cef 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -177,7 +177,6 @@ int WAIT_FOR_IO_CHANNEL(struct spar_io_channel_protocol __iomem *chanptr) int count = 120; while (count > 0) { - if (SPAR_CHANNEL_SERVER_READY(&chanptr->channel_header)) return 1; UIS_THREAD_WAIT_SEC(1); @@ -348,7 +347,6 @@ static int add_vhba(struct add_virt_guestpart *addparams) POSTCODE_SEVERITY_INFO); } return i; - } /* for CHANSOCK macaddr is AUTO-GENERATED; for normal channels, @@ -1566,7 +1564,6 @@ static void __exit virtpci_mod_exit(void) bus_unregister(&virtpci_bus_type); debugfs_remove_recursive(virtpci_debugfs_dir); LOGINF("Leaving\n"); - } module_init(virtpci_mod_init); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/9] staging: unisys: virtpci: Add braces to if/else statements
Update if/else blocks with braces on both the if and the else blocks in virtpci.c. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virtpci/virtpci.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index baf12e5..07d1966 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -847,8 +847,9 @@ static int virtpci_device_probe(struct device *dev) virtpcidev->mydriver = virtpcidrv; POSTCODE_LINUX_2(VPCI_PROBE_EXIT_PC, POSTCODE_SEVERITY_INFO); - } else + } else { put_device(dev); + } } POSTCODE_LINUX_2(VPCI_PROBE_FAILURE_PC, POSTCODE_SEVERITY_ERR); return error; /* -ENODEV for probe failure */ @@ -992,9 +993,9 @@ static int virtpci_device_add(struct device *parentbus, int devtype, } /* add it at the head */ - if (!VpcidevListHead) + if (!VpcidevListHead) { VpcidevListHead = virtpcidev; - else { + } else { /* insert virtpcidev at the head of our linked list of * vpcidevs */ -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/9] Cleanup in virtpci.c
This series of patches cleans up some simple checkpatch.pl findings in virtpci.c Bryan Thompson (9): staging: unisys: virtpci: Add a blank line after the definition of driver_private staging: unisys: virtpci: Remove extraneous blank lines staging: unisys: virtpci: Remove space between cast and variable staging: unisys: virtpci: Allocate memory using the size of the variable staging: unisys: virtpci: Place logical continuation at the end of a line staging: unisys: virtpci: Add braces to if/else statements staging: unisys: virtpci: Use a single blank line to separate code blocks staging: unisys: virtpci: Fix alignment issues staging: unisys: virtpci: Adjust lines to contain a maximum of 80 characters drivers/staging/unisys/virtpci/virtpci.c | 81 +++--- 1 file changed, 41 insertions(+), 40 deletions(-) -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/9] staging: unisys: virtpci: Remove space between cast and variable
Remove the whitespace between a cast and a variable in virtpci.c. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virtpci/virtpci.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 7b00cef..560639a 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -200,7 +200,7 @@ static int write_vbus_chpInfo(struct spar_vbus_channel_protocol *chan, LOGERR("vbus channel not used, because chp_info_offset == 0"); return -1; } - memcpy(((u8 *) (chan)) + off, info, sizeof(*info)); + memcpy(((u8 *)(chan)) + off, info, sizeof(*info)); return 0; } @@ -219,7 +219,7 @@ static int write_vbus_busInfo(struct spar_vbus_channel_protocol *chan, LOGERR("vbus channel not used, because bus_info_offset == 0"); return -1; } - memcpy(((u8 *) (chan)) + off, info, sizeof(*info)); + memcpy(((u8 *)(chan)) + off, info, sizeof(*info)); return 0; } @@ -244,7 +244,7 @@ write_vbus_devInfo(struct spar_vbus_channel_protocol *chan, LOGERR("vbus channel not used, because dev_info_offset == 0"); return -1; } - memcpy(((u8 *) (chan)) + off, info, sizeof(*info)); + memcpy(((u8 *)(chan)) + off, info, sizeof(*info)); return 0; } @@ -325,7 +325,7 @@ static int add_vhba(struct add_virt_guestpart *addparams) POSTCODE_LINUX_2(VPCI_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO); if (!WAIT_FOR_IO_CHANNEL - ((struct spar_io_channel_protocol __iomem *) addparams->chanptr)) { + ((struct spar_io_channel_protocol __iomem *)addparams->chanptr)) { LOGERR("Timed out. Channel not ready\n"); POSTCODE_LINUX_2(VPCI_CREATE_FAILURE_PC, POSTCODE_SEVERITY_ERR); return 0; @@ -355,16 +355,16 @@ static int add_vhba(struct add_virt_guestpart *addparams) #define GET_NETADAPINFO_FROM_CHANPTR(chanptr) { \ memcpy_fromio(net.mac_addr, \ ((struct spar_io_channel_protocol __iomem *) \ - chanptr)->vnic.macaddr, \ + chanptr)->vnic.macaddr, \ MAX_MACADDR_LEN);\ net.num_rcv_bufs = \ readl(&((struct spar_io_channel_protocol __iomem *)\ - chanptr)->vnic.num_rcv_bufs); \ + chanptr)->vnic.num_rcv_bufs); \ net.mtu = readl(&((struct spar_io_channel_protocol __iomem *) \ - chanptr)->vnic.mtu); \ + chanptr)->vnic.mtu);\ memcpy_fromio(&net.zone_uuid, \ &((struct spar_io_channel_protocol __iomem *)\ - chanptr)->vnic.zone_uuid, \ + chanptr)->vnic.zone_uuid, \ sizeof(uuid_le)); \ } @@ -381,7 +381,7 @@ add_vnic(struct add_virt_guestpart *addparams) POSTCODE_LINUX_2(VPCI_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO); if (!WAIT_FOR_IO_CHANNEL - ((struct spar_io_channel_protocol __iomem *) addparams->chanptr)) { + ((struct spar_io_channel_protocol __iomem *)addparams->chanptr)) { LOGERR("Timed out, channel not ready\n"); POSTCODE_LINUX_2(VPCI_CREATE_FAILURE_PC, POSTCODE_SEVERITY_ERR); return 0; @@ -431,7 +431,7 @@ delete_vbus_device(struct device *vbus, void *data) int checkforroot = (data != NULL); struct device *pDev = &virtpci_rootbus_device; - if ((checkforroot) && match_busid(vbus, (void *) BUS_ID(pDev))) { + if ((checkforroot) && match_busid(vbus, (void *)BUS_ID(pDev))) { /* skip it - don't delete root bus */ LOGINF("skipping root bus\n"); return 0; /* pretend no error */ @@ -606,7 +606,7 @@ static void delete_all(void) /* now delete each vbus */ if (bus_for_each_dev - (&virtpci_bus_type, NULL, (void *) 1, delete_vbus_device)) + (&virtpci_bus_type, NULL, (void *)1, delete_vbus_device)) LOGERR("delete of all vbus failed\n"); } @@ -1447,7 +1447,7 @@ static ssize_t info_debugfs_read(struct file *file, char __user *buf, printparam.buf
[PATCH 00/12] Fix CamelCase issues in virtpci.c
This patch series renames the checkpatch.pl flagged CamelCase names in virtpci.c Bryan Thompson (12): staging: unisys: virtpci: Fix CamelCase Chipset_DriverInfo staging: unisys: virtpci: Fix CamelCase virtpci device list head staging: unisys: virtpci: Fix CamelCase virtpci device list lock staging: unisys: virtpci: Fix CamelCase vbus driver info variable staging: unisys: virtpci: Fix CamelCase write_vbus_chpInfo() staging: unisys: virtpci: Fix CamelCase write_vbus_busInfo() staging: unisys: virtpci: Fix CamelCase write_vbus_devInfo() staging: unisys: virtpci: Fix CamelCase in delete_vbus_device() staging: unisys: virtpci: Fix CamelCase name fix_vbus_devInfo() staging: unisys: virtpci: Fix CamelCase parameters of fix_vbus_dev_info() staging: unisys: virtpci: Fix CamelCase local variables in fix_vbus_dev_info() staging: unisys: virtpci: Fix CamelCase local variables in virtpci_device_add() drivers/staging/unisys/virtpci/virtpci.c | 141 +++--- 1 file changed, 71 insertions(+), 70 deletions(-) -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/12] staging: unisys: virtpci: Fix CamelCase local variables in virtpci_device_add()
Rename the following local variables in virtpci_device_add() pIoChan changed to io_chan pDev changed to dev Signed-off-by: Bryan Thompson --- drivers/staging/unisys/virtpci/virtpci.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index bfcc027..e212c7a 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -910,8 +910,8 @@ static int virtpci_device_add(struct device *parentbus, int devtype, struct virtpci_dev *tmpvpcidev = NULL, *prev; unsigned long flags; int ret; - struct spar_io_channel_protocol __iomem *pIoChan = NULL; - struct device *pDev; + struct spar_io_channel_protocol __iomem *io_chan = NULL; + struct device *dev; LOGINF("virtpci_device_add parentbus:%p chanptr:%p\n", parentbus, addparams->chanptr); @@ -951,7 +951,7 @@ static int virtpci_device_add(struct device *parentbus, int devtype, virtpcidev->queueinfo.send_int_if_needed = NULL; /* Set up safe queue... */ - pIoChan = (struct spar_io_channel_protocol __iomem *) + io_chan = (struct spar_io_channel_protocol __iomem *) virtpcidev->queueinfo.chan; virtpcidev->intr = addparams->intr; @@ -1013,9 +1013,9 @@ static int virtpci_device_add(struct device *parentbus, int devtype, * registering the device, because polling of the channel * queues can begin at any time after device_register(). */ - pDev = &virtpcidev->generic_dev; + dev = &virtpcidev->generic_dev; SPAR_CHANNEL_CLIENT_TRANSITION(addparams->chanptr, - BUS_ID(pDev), + BUS_ID(dev), CHANNELCLI_ATTACHED, NULL); /* don't register until device has been added to @@ -1036,9 +1036,9 @@ static int virtpci_device_add(struct device *parentbus, int devtype, */ if (ret) { LOGERR("device_register returned %d\n", ret); - pDev = &virtpcidev->generic_dev; + dev = &virtpcidev->generic_dev; SPAR_CHANNEL_CLIENT_TRANSITION(addparams->chanptr, - BUS_ID(pDev), + BUS_ID(dev), CHANNELCLI_DETACHED, NULL); /* remove virtpcidev, the one we just added, from the list */ write_lock_irqsave(&vpcidev_list_lock, flags); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/12] staging: unisys: virtpci: Fix CamelCase write_vbus_chpInfo()
Rename write_vbus_chpInfo() to write_vbus_chp_info() in virtpci.c Signed-off-by: Bryan Thompson --- drivers/staging/unisys/virtpci/virtpci.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 7d997fd..5e1a7eb 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -186,8 +186,8 @@ int WAIT_FOR_IO_CHANNEL(struct spar_io_channel_protocol __iomem *chanptr) } /* Write the contents of to the ULTRA_VBUS_CHANNEL_PROTOCOL.ChpInfo. */ -static int write_vbus_chpInfo(struct spar_vbus_channel_protocol *chan, - struct ultra_vbus_deviceinfo *info) +static int write_vbus_chp_info(struct spar_vbus_channel_protocol *chan, + struct ultra_vbus_deviceinfo *info) { int off; @@ -279,8 +279,8 @@ static int add_vbus(struct add_vbus_guestpart *addparams) POSTCODE_LINUX_2(VPCI_CREATE_FAILURE_PC, POSTCODE_SEVERITY_ERR); return 0; } - write_vbus_chpInfo(vbus->platform_data /* chanptr */ , - &chipset_driver_info); + write_vbus_chp_info(vbus->platform_data /* chanptr */ , + &chipset_driver_info); write_vbus_busInfo(vbus->platform_data /* chanptr */ , &bus_driver_info); LOGINF("Added vbus %d; device %s created successfully\n", @@ -802,7 +802,7 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, int devType, /* Re-write bus+chipset info, because it is possible that this * was previously written by our good counterpart, visorbus. */ - write_vbus_chpInfo(pChan, &chipset_driver_info); + write_vbus_chp_info(pChan, &chipset_driver_info); write_vbus_busInfo(pChan, &bus_driver_info); } -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/12] staging: unisys: virtpci: Fix CamelCase parameters of fix_vbus_dev_info()
Rename the following fix_vbus_dev_info() parameters devNo changed to dev_no devType changed to dev_type Signed-off-by: Bryan Thompson --- drivers/staging/unisys/virtpci/virtpci.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index b4eaca2..80be233 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -756,7 +756,7 @@ static int virtpci_device_resume(struct device *dev) * the appropriate slot within the vbus channel of the bus * instance. */ -static void fix_vbus_dev_info(struct device *dev, int devNo, int devType, +static void fix_vbus_dev_info(struct device *dev, int dev_no, int dev_type, struct virtpci_driver *virtpcidrv) { struct device *vbus; @@ -782,7 +782,7 @@ static void fix_vbus_dev_info(struct device *dev, int devNo, int devType, LOGERR("%s dev bus has no channel", __func__); return; } - switch (devType) { + switch (dev_type) { case PCI_DEVICE_ID_VIRTHBA: stype = "vHBA"; break; @@ -797,7 +797,7 @@ static void fix_vbus_dev_info(struct device *dev, int devNo, int devType, virtpcidrv->name, virtpcidrv->version, virtpcidrv->vertag); - write_vbus_dev_info(pChan, &devInfo, devNo); + write_vbus_dev_info(pChan, &devInfo, dev_no); /* Re-write bus+chipset info, because it is possible that this * was previously written by our good counterpart, visorbus. -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/12] staging: unisys: virtpci: Fix CamelCase virtpci device list lock
Rename VpcidevListLock to vpcidev_list_lock in virtpci.c Signed-off-by: Bryan Thompson --- drivers/staging/unisys/virtpci/virtpci.c | 32 +++--- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 383be50..143bb00 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -150,7 +150,7 @@ static struct kobj_type virtpci_driver_kobj_type = { }; static struct virtpci_dev *vpcidev_list_head; -static DEFINE_RWLOCK(VpcidevListLock); +static DEFINE_RWLOCK(vpcidev_list_lock); /* filled in with info about this driver, wrt it servicing client busses */ static struct ultra_vbus_deviceinfo Bus_DriverInfo; @@ -589,10 +589,10 @@ static void delete_all(void) struct virtpci_dev *tmpvpcidev, *nextvpcidev; /* delete the entire vhba/vnic list in one shot */ - write_lock_irqsave(&VpcidevListLock, flags); + write_lock_irqsave(&vpcidev_list_lock, flags); tmpvpcidev = vpcidev_list_head; vpcidev_list_head = NULL; - write_unlock_irqrestore(&VpcidevListLock, flags); + write_unlock_irqrestore(&vpcidev_list_lock, flags); /* delete one vhba/vnic at a time */ while (tmpvpcidev) { @@ -966,7 +966,7 @@ static int virtpci_device_add(struct device *parentbus, int devtype, /* add the vhba/vnic to virtpci device list - but check for * duplicate wwnn/macaddr first */ - write_lock_irqsave(&VpcidevListLock, flags); + write_lock_irqsave(&vpcidev_list_lock, flags); for (tmpvpcidev = vpcidev_list_head; tmpvpcidev; tmpvpcidev = tmpvpcidev->next) { if (devtype == VIRTHBA_TYPE) { @@ -988,7 +988,7 @@ static int virtpci_device_add(struct device *parentbus, int devtype, /* found a vhba/vnic already in the list with same * wwnn or macaddr - reject add */ - write_unlock_irqrestore(&VpcidevListLock, flags); + write_unlock_irqrestore(&vpcidev_list_lock, flags); kfree(virtpcidev); LOGERR(" FAILED vhba/vnic already exists in the list\n"); POSTCODE_LINUX_2(VPCI_CREATE_FAILURE_PC, POSTCODE_SEVERITY_ERR); @@ -1006,7 +1006,7 @@ static int virtpci_device_add(struct device *parentbus, int devtype, vpcidev_list_head = virtpcidev; } - write_unlock_irqrestore(&VpcidevListLock, flags); + write_unlock_irqrestore(&vpcidev_list_lock, flags); /* Must transition channel to ATTACHED state BEFORE * registering the device, because polling of the channel @@ -1040,7 +1040,7 @@ static int virtpci_device_add(struct device *parentbus, int devtype, BUS_ID(pDev), CHANNELCLI_DETACHED, NULL); /* remove virtpcidev, the one we just added, from the list */ - write_lock_irqsave(&VpcidevListLock, flags); + write_lock_irqsave(&vpcidev_list_lock, flags); for (tmpvpcidev = vpcidev_list_head, prev = NULL; tmpvpcidev; prev = tmpvpcidev, tmpvpcidev = tmpvpcidev->next) { @@ -1052,7 +1052,7 @@ static int virtpci_device_add(struct device *parentbus, int devtype, break; } } - write_unlock_irqrestore(&VpcidevListLock, flags); + write_unlock_irqrestore(&vpcidev_list_lock, flags); kfree(virtpcidev); return 0; } @@ -1084,7 +1084,7 @@ static int virtpci_device_serverdown(struct device *parentbus, } /* find the vhba or vnic in virtpci device list */ - write_lock_irqsave(&VpcidevListLock, flags); + write_lock_irqsave(&vpcidev_list_lock, flags); for (tmpvpcidev = vpcidev_list_head, prevvpcidev = NULL; (tmpvpcidev && !found); @@ -1114,7 +1114,7 @@ static int virtpci_device_serverdown(struct device *parentbus, vpcidriver = tmpvpcidev->mydriver; rc = vpcidriver->suspend(tmpvpcidev, 0); } - write_unlock_irqrestore(&VpcidevListLock, flags); + write_unlock_irqrestore(&vpcidev_list_lock, flags); if (!found) { LOGERR(" FAILED to find vhba/vnic in the list\n"); @@ -1143,7 +1143,7 @@ static int virtpci_device_serverup(struct device *parentbus, } /* find the vhba or vnic in virtpci device list */ - write_lock_irqsave(&VpcidevListLock, flags); + write_lock_irqsave(&vpcidev_list_lock, flags); for (tmpvpcidev = vpcidev_list_head, prevvpcidev = NULL; (tmpvpcidev &&a
[PATCH 04/12] staging: unisys: virtpci: Fix CamelCase vbus driver info variable
Rename BusDriverInfo variable to bus_driver_info in virtpci.c Signed-off-by: Bryan Thompson --- drivers/staging/unisys/virtpci/virtpci.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 143bb00..7d997fd 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -153,7 +153,7 @@ static struct virtpci_dev *vpcidev_list_head; static DEFINE_RWLOCK(vpcidev_list_lock); /* filled in with info about this driver, wrt it servicing client busses */ -static struct ultra_vbus_deviceinfo Bus_DriverInfo; +static struct ultra_vbus_deviceinfo bus_driver_info; /*/ /* debugfs entries */ @@ -281,7 +281,8 @@ static int add_vbus(struct add_vbus_guestpart *addparams) } write_vbus_chpInfo(vbus->platform_data /* chanptr */ , &chipset_driver_info); - write_vbus_busInfo(vbus->platform_data /* chanptr */ , &Bus_DriverInfo); + write_vbus_busInfo(vbus->platform_data /* chanptr */ , + &bus_driver_info); LOGINF("Added vbus %d; device %s created successfully\n", addparams->bus_no, BUS_ID(vbus)); POSTCODE_LINUX_2(VPCI_CREATE_EXIT_PC, POSTCODE_SEVERITY_INFO); @@ -802,7 +803,7 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, int devType, * was previously written by our good counterpart, visorbus. */ write_vbus_chpInfo(pChan, &chipset_driver_info); - write_vbus_busInfo(pChan, &Bus_DriverInfo); + write_vbus_busInfo(pChan, &bus_driver_info); } /* This function is called to query the existence of a specific device @@ -1521,7 +1522,7 @@ static int __init virtpci_mod_init(void) return ret; } DBGINF("bus_register successful\n"); - bus_device_info_init(&Bus_DriverInfo, "clientbus", "virtpci", + bus_device_info_init(&bus_driver_info, "clientbus", "virtpci", VERSION, NULL); /* create a root bus used to parent all the virtpci buses. */ -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/12] staging: unisys: virtpci: Fix CamelCase name fix_vbus_devInfo()
Rename fix_vbus_devInfo() to fix_vbus_dev_info(). Signed-off-by: Bryan Thompson --- drivers/staging/unisys/virtpci/virtpci.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index b6e508f..b4eaca2 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -756,8 +756,8 @@ static int virtpci_device_resume(struct device *dev) * the appropriate slot within the vbus channel of the bus * instance. */ -static void fix_vbus_devInfo(struct device *dev, int devNo, int devType, -struct virtpci_driver *virtpcidrv) +static void fix_vbus_dev_info(struct device *dev, int devNo, int devType, + struct virtpci_driver *virtpcidrv) { struct device *vbus; void *pChan; @@ -843,8 +843,8 @@ static int virtpci_device_probe(struct device *dev) */ error = virtpcidrv->probe(virtpcidev, id); if (!error) { - fix_vbus_devInfo(dev, virtpcidev->device_no, -virtpcidev->device, virtpcidrv); + fix_vbus_dev_info(dev, virtpcidev->device_no, + virtpcidev->device, virtpcidrv); virtpcidev->mydriver = virtpcidrv; POSTCODE_LINUX_2(VPCI_PROBE_EXIT_PC, POSTCODE_SEVERITY_INFO); @@ -1177,9 +1177,9 @@ static int virtpci_device_serverup(struct device *parentbus, * ever have a bus that contains NO devices, since we * would never even get here in that case. */ - fix_vbus_devInfo(&tmpvpcidev->generic_dev, -tmpvpcidev->device_no, -tmpvpcidev->device, vpcidriver); + fix_vbus_dev_info(&tmpvpcidev->generic_dev, + tmpvpcidev->device_no, + tmpvpcidev->device, vpcidriver); rc = vpcidriver->resume(tmpvpcidev); } -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/12] staging: unisys: virtpci: Fix CamelCase virtpci device list head
Rename VpcidevListHead to vpcidev_list_head in virtpci.c Signed-off-by: Bryan Thompson --- drivers/staging/unisys/virtpci/virtpci.c | 32 +++--- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 6b4d94c..383be50 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -149,7 +149,7 @@ static struct kobj_type virtpci_driver_kobj_type = { .sysfs_ops = &virtpci_driver_sysfs_ops, }; -static struct virtpci_dev *VpcidevListHead; +static struct virtpci_dev *vpcidev_list_head; static DEFINE_RWLOCK(VpcidevListLock); /* filled in with info about this driver, wrt it servicing client busses */ @@ -590,8 +590,8 @@ static void delete_all(void) /* delete the entire vhba/vnic list in one shot */ write_lock_irqsave(&VpcidevListLock, flags); - tmpvpcidev = VpcidevListHead; - VpcidevListHead = NULL; + tmpvpcidev = vpcidev_list_head; + vpcidev_list_head = NULL; write_unlock_irqrestore(&VpcidevListLock, flags); /* delete one vhba/vnic at a time */ @@ -967,7 +967,7 @@ static int virtpci_device_add(struct device *parentbus, int devtype, * duplicate wwnn/macaddr first */ write_lock_irqsave(&VpcidevListLock, flags); - for (tmpvpcidev = VpcidevListHead; tmpvpcidev; + for (tmpvpcidev = vpcidev_list_head; tmpvpcidev; tmpvpcidev = tmpvpcidev->next) { if (devtype == VIRTHBA_TYPE) { if ((tmpvpcidev->scsi.wwnn.wwnn1 == scsi->wwnn.wwnn1) && @@ -996,14 +996,14 @@ static int virtpci_device_add(struct device *parentbus, int devtype, } /* add it at the head */ - if (!VpcidevListHead) { - VpcidevListHead = virtpcidev; + if (!vpcidev_list_head) { + vpcidev_list_head = virtpcidev; } else { /* insert virtpcidev at the head of our linked list of * vpcidevs */ - virtpcidev->next = VpcidevListHead; - VpcidevListHead = virtpcidev; + virtpcidev->next = vpcidev_list_head; + vpcidev_list_head = virtpcidev; } write_unlock_irqrestore(&VpcidevListLock, flags); @@ -1041,14 +1041,14 @@ static int virtpci_device_add(struct device *parentbus, int devtype, CHANNELCLI_DETACHED, NULL); /* remove virtpcidev, the one we just added, from the list */ write_lock_irqsave(&VpcidevListLock, flags); - for (tmpvpcidev = VpcidevListHead, prev = NULL; + for (tmpvpcidev = vpcidev_list_head, prev = NULL; tmpvpcidev; prev = tmpvpcidev, tmpvpcidev = tmpvpcidev->next) { if (tmpvpcidev == virtpcidev) { if (prev) prev->next = tmpvpcidev->next; else - VpcidevListHead = tmpvpcidev->next; + vpcidev_list_head = tmpvpcidev->next; break; } } @@ -1086,7 +1086,7 @@ static int virtpci_device_serverdown(struct device *parentbus, /* find the vhba or vnic in virtpci device list */ write_lock_irqsave(&VpcidevListLock, flags); - for (tmpvpcidev = VpcidevListHead, prevvpcidev = NULL; + for (tmpvpcidev = vpcidev_list_head, prevvpcidev = NULL; (tmpvpcidev && !found); prevvpcidev = tmpvpcidev, tmpvpcidev = tmpvpcidev->next) { if (tmpvpcidev->devtype != devtype) @@ -1145,7 +1145,7 @@ static int virtpci_device_serverup(struct device *parentbus, /* find the vhba or vnic in virtpci device list */ write_lock_irqsave(&VpcidevListLock, flags); - for (tmpvpcidev = VpcidevListHead, prevvpcidev = NULL; + for (tmpvpcidev = vpcidev_list_head, prevvpcidev = NULL; (tmpvpcidev && !found); prevvpcidev = tmpvpcidev, tmpvpcidev = tmpvpcidev->next) { if (tmpvpcidev->devtype != devtype) @@ -1224,7 +1224,7 @@ static int virtpci_device_del(struct device *parentbus, * encounter "schedule while atomic" */ write_lock_irqsave(&VpcidevListLock, flags); - for (tmpvpcidev = VpcidevListHead, prevvpcidev = NULL; tmpvpcidev;) { + for (tmpvpcidev = vpcidev_list_head, prevvpcidev = NULL; tmpvpcidev;) { if (tmpvpcidev->devtype != devtype) DEL_CONTINUE; @@ -1258,7 +1258,7 @@ static int virtpci_device_del(struct device *parentbus,
[PATCH 07/12] staging: unisys: virtpci: Fix CamelCase write_vbus_devInfo()
Rename write_vbus_devInfo() to write_vbus_dev_info() in virtpci.c Signed-off-by: Bryan Thompson --- drivers/staging/unisys/virtpci/virtpci.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index c992b9f..a299b32 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -227,8 +227,8 @@ static int write_vbus_bus_info(struct spar_vbus_channel_protocol *chan, * ULTRA_VBUS_CHANNEL_PROTOCOL.DevInfo[]. */ static int -write_vbus_devInfo(struct spar_vbus_channel_protocol *chan, - struct ultra_vbus_deviceinfo *info, int devix) +write_vbus_dev_info(struct spar_vbus_channel_protocol *chan, + struct ultra_vbus_deviceinfo *info, int devix) { int off; @@ -797,7 +797,7 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, int devType, virtpcidrv->name, virtpcidrv->version, virtpcidrv->vertag); - write_vbus_devInfo(pChan, &devInfo, devNo); + write_vbus_dev_info(pChan, &devInfo, devNo); /* Re-write bus+chipset info, because it is possible that this * was previously written by our good counterpart, visorbus. -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/12] staging: unisys: virtpci: Fix CamelCase local variables in fix_vbus_dev_info()
Rename the following local variables in fix_vbus_dev_info() Change pChan to chan Change devInfo to dev_info Signed-off-by: Bryan Thompson --- drivers/staging/unisys/virtpci/virtpci.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 80be233..bfcc027 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -760,8 +760,8 @@ static void fix_vbus_dev_info(struct device *dev, int dev_no, int dev_type, struct virtpci_driver *virtpcidrv) { struct device *vbus; - void *pChan; - struct ultra_vbus_deviceinfo devInfo; + void *chan; + struct ultra_vbus_deviceinfo dev_info; const char *stype; if (!dev) { @@ -777,8 +777,8 @@ static void fix_vbus_dev_info(struct device *dev, int dev_no, int dev_type, LOGERR("%s dev has no parent bus", __func__); return; } - pChan = vbus->platform_data; - if (!pChan) { + chan = vbus->platform_data; + if (!chan) { LOGERR("%s dev bus has no channel", __func__); return; } @@ -793,17 +793,17 @@ static void fix_vbus_dev_info(struct device *dev, int dev_no, int dev_type, stype = "unknown"; break; } - bus_device_info_init(&devInfo, stype, + bus_device_info_init(&dev_info, stype, virtpcidrv->name, virtpcidrv->version, virtpcidrv->vertag); - write_vbus_dev_info(pChan, &devInfo, dev_no); + write_vbus_dev_info(chan, &dev_info, dev_no); /* Re-write bus+chipset info, because it is possible that this * was previously written by our good counterpart, visorbus. */ - write_vbus_chp_info(pChan, &chipset_driver_info); - write_vbus_bus_info(pChan, &bus_driver_info); + write_vbus_chp_info(chan, &chipset_driver_info); + write_vbus_bus_info(chan, &bus_driver_info); } /* This function is called to query the existence of a specific device -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/12] staging: unisys: virtpci: Fix CamelCase in delete_vbus_device()
Rename pDev to dev in delete_vbus_device() Signed-off-by: Bryan Thompson --- drivers/staging/unisys/virtpci/virtpci.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index a299b32..b6e508f 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -430,9 +430,9 @@ static int delete_vbus_device(struct device *vbus, void *data) { int checkforroot = (data != NULL); - struct device *pDev = &virtpci_rootbus_device; + struct device *dev = &virtpci_rootbus_device; - if ((checkforroot) && match_busid(vbus, (void *)BUS_ID(pDev))) { + if ((checkforroot) && match_busid(vbus, (void *)BUS_ID(dev))) { /* skip it - don't delete root bus */ LOGINF("skipping root bus\n"); return 0; /* pretend no error */ -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/12] staging: unisys: virtpci: Fix CamelCase write_vbus_busInfo()
Rename write_vbus_busInfo() to write_vbus_bus_info() in virtpci.c Signed-off-by: Bryan Thompson --- drivers/staging/unisys/virtpci/virtpci.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 5e1a7eb..c992b9f 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -205,8 +205,8 @@ static int write_vbus_chp_info(struct spar_vbus_channel_protocol *chan, } /* Write the contents of to the ULTRA_VBUS_CHANNEL_PROTOCOL.BusInfo. */ -static int write_vbus_busInfo(struct spar_vbus_channel_protocol *chan, - struct ultra_vbus_deviceinfo *info) +static int write_vbus_bus_info(struct spar_vbus_channel_protocol *chan, + struct ultra_vbus_deviceinfo *info) { int off; @@ -281,8 +281,8 @@ static int add_vbus(struct add_vbus_guestpart *addparams) } write_vbus_chp_info(vbus->platform_data /* chanptr */ , &chipset_driver_info); - write_vbus_busInfo(vbus->platform_data /* chanptr */ , - &bus_driver_info); + write_vbus_bus_info(vbus->platform_data /* chanptr */ , + &bus_driver_info); LOGINF("Added vbus %d; device %s created successfully\n", addparams->bus_no, BUS_ID(vbus)); POSTCODE_LINUX_2(VPCI_CREATE_EXIT_PC, POSTCODE_SEVERITY_INFO); @@ -803,7 +803,7 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, int devType, * was previously written by our good counterpart, visorbus. */ write_vbus_chp_info(pChan, &chipset_driver_info); - write_vbus_busInfo(pChan, &bus_driver_info); + write_vbus_bus_info(pChan, &bus_driver_info); } /* This function is called to query the existence of a specific device -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/12] staging: unisys: virtpci: Fix CamelCase Chipset_DriverInfo
Rename Chipset_DriverInfo to chipset_driver_info in virtpci.c Signed-off-by: Bryan Thompson --- drivers/staging/unisys/virtpci/virtpci.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index b6c3130..6b4d94c 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -138,7 +138,7 @@ static struct device virtpci_rootbus_device = { }; /* filled in with info about parent chipset driver when we register with it */ -static struct ultra_vbus_deviceinfo Chipset_DriverInfo; +static struct ultra_vbus_deviceinfo chipset_driver_info; static const struct sysfs_ops virtpci_driver_sysfs_ops = { .show = virtpci_driver_attr_show, @@ -280,7 +280,7 @@ static int add_vbus(struct add_vbus_guestpart *addparams) return 0; } write_vbus_chpInfo(vbus->platform_data /* chanptr */ , - &Chipset_DriverInfo); + &chipset_driver_info); write_vbus_busInfo(vbus->platform_data /* chanptr */ , &Bus_DriverInfo); LOGINF("Added vbus %d; device %s created successfully\n", addparams->bus_no, BUS_ID(vbus)); @@ -801,7 +801,7 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, int devType, /* Re-write bus+chipset info, because it is possible that this * was previously written by our good counterpart, visorbus. */ - write_vbus_chpInfo(pChan, &Chipset_DriverInfo); + write_vbus_chpInfo(pChan, &chipset_driver_info); write_vbus_busInfo(pChan, &Bus_DriverInfo); } @@ -1536,7 +1536,7 @@ static int __init virtpci_mod_init(void) DBGINF("device_register successful ret:%x\n", ret); if (!uisctrl_register_req_handler(2, (void *)&virtpci_ctrlchan_func, - &Chipset_DriverInfo)) { + &chipset_driver_info)) { LOGERR("uisctrl_register_req_handler FAILED.\n"); POSTCODE_LINUX_2(VPCI_CREATE_FAILURE_PC, POSTCODE_SEVERITY_ERR); device_unregister(&virtpci_rootbus_device); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel