From patchwork Fri Jun 27 11:25:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 364884 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E162D1400DD for ; Fri, 27 Jun 2014 21:29:35 +1000 (EST) Received: from localhost ([::1]:49419 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0ULW-0000Kw-4D for incoming@patchwork.ozlabs.org; Fri, 27 Jun 2014 07:29:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0UHr-0001mN-Vw for qemu-devel@nongnu.org; Fri, 27 Jun 2014 07:25:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0UHf-0007K4-9V for qemu-devel@nongnu.org; Fri, 27 Jun 2014 07:25:47 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:37687) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0UHe-0007Jn-L4 for qemu-devel@nongnu.org; Fri, 27 Jun 2014 07:25:35 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Jun 2014 12:25:33 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 27 Jun 2014 12:25:31 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id EA82C1B08051 for ; Fri, 27 Jun 2014 12:26:03 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s5RBPVVG6226064 for ; Fri, 27 Jun 2014 11:25:31 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s5RBPURw005778 for ; Fri, 27 Jun 2014 05:25:30 -0600 Received: from gondolin.boeblingen.de.ibm.com (dyn-9-152-224-107.boeblingen.de.ibm.com [9.152.224.107]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s5RBPTVT005693; Fri, 27 Jun 2014 05:25:30 -0600 From: Cornelia Huck To: qemu-devel@nongnu.org Date: Fri, 27 Jun 2014 13:25:17 +0200 Message-Id: <1403868326-7718-2-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1403868326-7718-1-git-send-email-cornelia.huck@de.ibm.com> References: <1403868326-7718-1-git-send-email-cornelia.huck@de.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14062711-4966-0000-0000-0000008666FB X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.106 Cc: peter.maydell@linaro.org, agraf@suse.de, borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, aliguori@amazon.com, Cornelia Huck , "Eugene \(jno\) Dvurechenski" Subject: [Qemu-devel] [PULL 01/10] pc-bios/s390-ccw: make checkpatch happy X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Eugene (jno) Dvurechenski" Remove tabs, tweak whitespace and comments. Acked-by: Christian Borntraeger Signed-off-by: Eugene (jno) Dvurechenski Signed-off-by: Jens Freimann Signed-off-by: Cornelia Huck --- pc-bios/s390-ccw/bootmap.c | 37 ++++++++++++++++++++----------------- pc-bios/s390-ccw/s390-ccw.h | 20 ++++++++++---------- pc-bios/s390-ccw/sclp-ascii.c | 4 ++-- pc-bios/s390-ccw/virtio.c | 26 +++++++++++++------------- pc-bios/s390-ccw/virtio.h | 2 +- 5 files changed, 46 insertions(+), 43 deletions(-) diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index 5ee3fcb..753c288 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -10,7 +10,7 @@ #include "s390-ccw.h" -// #define DEBUG_FALLBACK +/* #define DEBUG_FALLBACK */ #ifdef DEBUG_FALLBACK #define dputs(txt) \ @@ -47,13 +47,13 @@ struct mbr { struct scsi_blockptr blockptr; } __attribute__ ((packed)); -#define ZIPL_MAGIC "zIPL" +#define ZIPL_MAGIC "zIPL" -#define ZIPL_COMP_HEADER_IPL 0x00 -#define ZIPL_COMP_HEADER_DUMP 0x01 +#define ZIPL_COMP_HEADER_IPL 0x00 +#define ZIPL_COMP_HEADER_DUMP 0x01 -#define ZIPL_COMP_ENTRY_LOAD 0x02 -#define ZIPL_COMP_ENTRY_EXEC 0x01 +#define ZIPL_COMP_ENTRY_LOAD 0x02 +#define ZIPL_COMP_ENTRY_EXEC 0x01 /* Scratch space */ static uint8_t sec[SECTOR_SIZE] __attribute__((__aligned__(SECTOR_SIZE))); @@ -107,8 +107,8 @@ static void jump_to_IPL_code(uint64_t address) /* Check for ZIPL magic. Returns 0 if not matched. */ static int zipl_magic(uint8_t *ptr) { - uint32_t *p = (void*)ptr; - uint32_t *z = (void*)ZIPL_MAGIC; + uint32_t *p = (void *)ptr; + uint32_t *z = (void *)ZIPL_MAGIC; if (*p != *z) { debug_print_int("invalid magic", *p); @@ -136,7 +136,7 @@ static inline bool unused_space(const void *p, unsigned int size) static int zipl_load_segment(struct component_entry *entry) { const int max_entries = (SECTOR_SIZE / sizeof(struct scsi_blockptr)); - struct scsi_blockptr *bprs = (void*)sec; + struct scsi_blockptr *bprs = (void *)sec; const int bprs_size = sizeof(sec); uint64_t blockno; long address; @@ -156,16 +156,18 @@ static int zipl_load_segment(struct component_entry *entry) } for (i = 0;; i++) { - u64 *cur_desc = (void*)&bprs[i]; + u64 *cur_desc = (void *)&bprs[i]; blockno = bprs[i].blockno; - if (!blockno) + if (!blockno) { break; + } /* we need the updated blockno for the next indirect entry in the chain, but don't want to advance address */ - if (i == (max_entries - 1)) + if (i == (max_entries - 1)) { break; + } if (bprs[i].blockct == 0 && unused_space(&bprs[i + 1], sizeof(struct scsi_blockptr))) { @@ -178,9 +180,10 @@ static int zipl_load_segment(struct component_entry *entry) break; } address = virtio_load_direct(cur_desc[0], cur_desc[1], 0, - (void*)address); - if (address == -1) + (void *)address); + if (address == -1) { goto fail; + } } } while (blockno); @@ -220,7 +223,7 @@ static int zipl_run(struct scsi_blockptr *pte) entry++; - if ((uint8_t*)(&entry[1]) > (tmp_sec + SECTOR_SIZE)) { + if ((uint8_t *)(&entry[1]) > (tmp_sec + SECTOR_SIZE)) { goto fail; } } @@ -241,7 +244,7 @@ fail: int zipl_load(void) { - struct mbr *mbr = (void*)sec; + struct mbr *mbr = (void *)sec; uint8_t *ns, *ns_end; int program_table_entries = 0; int pte_len = sizeof(struct scsi_blockptr); @@ -249,7 +252,7 @@ int zipl_load(void) const char *error = ""; /* Grab the MBR */ - virtio_read(0, (void*)mbr); + virtio_read(0, (void *)mbr); dputs("checking magic\n"); diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index 5e871ac..fe1dd22 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -34,10 +34,10 @@ typedef unsigned long long __u64; #define PAGE_SIZE 4096 #ifndef EIO -#define EIO 1 +#define EIO 1 #endif #ifndef EBUSY -#define EBUSY 2 +#define EBUSY 2 #endif #ifndef NULL #define NULL 0 @@ -57,7 +57,7 @@ void sclp_setup(void); /* virtio.c */ unsigned long virtio_load_direct(ulong rec_list1, ulong rec_list2, - ulong subchan_id, void *load_addr); + ulong subchan_id, void *load_addr); bool virtio_is_blk(struct subchannel_id schid); void virtio_setup_block(struct subchannel_id schid); int virtio_read(ulong sector, void *load_addr); @@ -88,7 +88,7 @@ static inline void fill_hex(char *out, unsigned char val) static inline void print_int(const char *desc, u64 addr) { - unsigned char *addr_c = (unsigned char*)&addr; + unsigned char *addr_c = (unsigned char *)&addr; char out[] = ": 0xffffffffffffffff\n"; unsigned int i; @@ -118,16 +118,16 @@ static inline void debug_print_addr(const char *desc, void *p) * Hypercall functions * ***********************************************/ -#define KVM_S390_VIRTIO_NOTIFY 0 -#define KVM_S390_VIRTIO_RESET 1 -#define KVM_S390_VIRTIO_SET_STATUS 2 +#define KVM_S390_VIRTIO_NOTIFY 0 +#define KVM_S390_VIRTIO_RESET 1 +#define KVM_S390_VIRTIO_SET_STATUS 2 #define KVM_S390_VIRTIO_CCW_NOTIFY 3 static inline void yield(void) { - asm volatile ("diag 0,0,0x44" - : : - : "memory", "cc"); + asm volatile ("diag 0,0,0x44" + : : + : "memory", "cc"); } #define SECTOR_SIZE 512 diff --git a/pc-bios/s390-ccw/sclp-ascii.c b/pc-bios/s390-ccw/sclp-ascii.c index 1c93937..761fb44 100644 --- a/pc-bios/s390-ccw/sclp-ascii.c +++ b/pc-bios/s390-ccw/sclp-ascii.c @@ -33,7 +33,7 @@ static int sclp_service_call(unsigned int command, void *sccb) static void sclp_set_write_mask(void) { - WriteEventMask *sccb = (void*)_sccb; + WriteEventMask *sccb = (void *)_sccb; sccb->h.length = sizeof(WriteEventMask); sccb->mask_length = sizeof(unsigned int); @@ -68,7 +68,7 @@ static void _memcpy(char *dest, const char *src, int len) void sclp_print(const char *str) { int len = _strlen(str); - WriteEventData *sccb = (void*)_sccb; + WriteEventData *sccb = (void *)_sccb; sccb->h.length = sizeof(WriteEventData) + len; sccb->h.function_code = SCLP_FC_NORMAL_WRITE; diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c index bbb3c4f..c845b14 100644 --- a/pc-bios/s390-ccw/virtio.c +++ b/pc-bios/s390-ccw/virtio.c @@ -18,22 +18,22 @@ static char chsc_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE))); static long kvm_hypercall(unsigned long nr, unsigned long param1, unsigned long param2) { - register ulong r_nr asm("1") = nr; - register ulong r_param1 asm("2") = param1; - register ulong r_param2 asm("3") = param2; - register long retval asm("2"); + register ulong r_nr asm("1") = nr; + register ulong r_param1 asm("2") = param1; + register ulong r_param2 asm("3") = param2; + register long retval asm("2"); - asm volatile ("diag 2,4,0x500" - : "=d" (retval) - : "d" (r_nr), "0" (r_param1), "r"(r_param2) - : "memory", "cc"); + asm volatile ("diag 2,4,0x500" + : "=d" (retval) + : "d" (r_nr), "0" (r_param1), "r"(r_param2) + : "memory", "cc"); - return retval; + return retval; } static void virtio_notify(struct subchannel_id schid) { - kvm_hypercall(KVM_S390_VIRTIO_CCW_NOTIFY, *(u32*)&schid, 0); + kvm_hypercall(KVM_S390_VIRTIO_CCW_NOTIFY, *(u32 *)&schid, 0); } /*********************************************** @@ -236,7 +236,7 @@ static int virtio_read_many(ulong sector, void *load_addr, int sec_num) } unsigned long virtio_load_direct(ulong rec_list1, ulong rec_list2, - ulong subchan_id, void *load_addr) + ulong subchan_id, void *load_addr) { u8 status; int sec = rec_list1; @@ -249,7 +249,7 @@ unsigned long virtio_load_direct(ulong rec_list1, ulong rec_list2, } sclp_print("."); - status = virtio_read_many(sec, (void*)addr, sec_num); + status = virtio_read_many(sec, (void *)addr, sec_num); if (status) { virtio_panic("I/O Error"); } @@ -274,7 +274,7 @@ void virtio_setup_block(struct subchannel_id schid) if (run_ccw(schid, CCW_CMD_READ_VQ_CONF, &config, sizeof(config))) { virtio_panic("Could not get block device configuration\n"); } - vring_init(&block, config.num, (void*)(100 * 1024 * 1024), + vring_init(&block, config.num, (void *)(100 * 1024 * 1024), KVM_S390_VIRTIO_RING_ALIGN); info.queue = (100ULL * 1024ULL* 1024ULL); diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h index 772a63f..c2990ea 100644 --- a/pc-bios/s390-ccw/virtio.h +++ b/pc-bios/s390-ccw/virtio.h @@ -66,7 +66,7 @@ struct virtio_dev { char *config; }; -#define KVM_S390_VIRTIO_RING_ALIGN 4096 +#define KVM_S390_VIRTIO_RING_ALIGN 4096 #define VRING_USED_F_NO_NOTIFY 1