summaryrefslogtreecommitdiff
path: root/pc-bios
diff options
context:
space:
mode:
authorEugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>2014-05-19 20:05:40 +0200
committerCornelia Huck <cornelia.huck@de.ibm.com>2014-06-27 11:57:25 +0200
commitabd696e4f74a9d30801c6ae2693efe4e5979c2f2 (patch)
tree3e674bbab201531e69ac340bc0a496201f0463e0 /pc-bios
parentff4873cb8c81db89668d8b56e19e57b852edb5f5 (diff)
downloadqemu-abd696e4f74a9d30801c6ae2693efe4e5979c2f2.zip
pc-bios/s390-ccw: make checkpatch happy
Remove tabs, tweak whitespace and comments. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'pc-bios')
-rw-r--r--pc-bios/s390-ccw/bootmap.c37
-rw-r--r--pc-bios/s390-ccw/s390-ccw.h20
-rw-r--r--pc-bios/s390-ccw/sclp-ascii.c4
-rw-r--r--pc-bios/s390-ccw/virtio.c26
-rw-r--r--pc-bios/s390-ccw/virtio.h2
5 files changed, 46 insertions, 43 deletions
diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
index 5ee3fcb38f..753c28854e 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 5e871ac84c..fe1dd222ec 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 1c93937104..761fb44ff5 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 bbb3c4f36d..c845b14204 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 772a63f152..c2990eab54 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