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>
This commit is contained in:
Eugene (jno) Dvurechenski 2014-05-19 20:05:40 +02:00 committed by Cornelia Huck
parent ff4873cb8c
commit abd696e4f7
5 changed files with 46 additions and 43 deletions

View file

@ -10,7 +10,7 @@
#include "s390-ccw.h" #include "s390-ccw.h"
// #define DEBUG_FALLBACK /* #define DEBUG_FALLBACK */
#ifdef DEBUG_FALLBACK #ifdef DEBUG_FALLBACK
#define dputs(txt) \ #define dputs(txt) \
@ -107,8 +107,8 @@ static void jump_to_IPL_code(uint64_t address)
/* Check for ZIPL magic. Returns 0 if not matched. */ /* Check for ZIPL magic. Returns 0 if not matched. */
static int zipl_magic(uint8_t *ptr) static int zipl_magic(uint8_t *ptr)
{ {
uint32_t *p = (void*)ptr; uint32_t *p = (void *)ptr;
uint32_t *z = (void*)ZIPL_MAGIC; uint32_t *z = (void *)ZIPL_MAGIC;
if (*p != *z) { if (*p != *z) {
debug_print_int("invalid magic", *p); 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) static int zipl_load_segment(struct component_entry *entry)
{ {
const int max_entries = (SECTOR_SIZE / sizeof(struct scsi_blockptr)); 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); const int bprs_size = sizeof(sec);
uint64_t blockno; uint64_t blockno;
long address; long address;
@ -156,16 +156,18 @@ static int zipl_load_segment(struct component_entry *entry)
} }
for (i = 0;; i++) { for (i = 0;; i++) {
u64 *cur_desc = (void*)&bprs[i]; u64 *cur_desc = (void *)&bprs[i];
blockno = bprs[i].blockno; blockno = bprs[i].blockno;
if (!blockno) if (!blockno) {
break; break;
}
/* we need the updated blockno for the next indirect entry in the /* we need the updated blockno for the next indirect entry in the
chain, but don't want to advance address */ chain, but don't want to advance address */
if (i == (max_entries - 1)) if (i == (max_entries - 1)) {
break; break;
}
if (bprs[i].blockct == 0 && unused_space(&bprs[i + 1], if (bprs[i].blockct == 0 && unused_space(&bprs[i + 1],
sizeof(struct scsi_blockptr))) { sizeof(struct scsi_blockptr))) {
@ -178,10 +180,11 @@ static int zipl_load_segment(struct component_entry *entry)
break; break;
} }
address = virtio_load_direct(cur_desc[0], cur_desc[1], 0, address = virtio_load_direct(cur_desc[0], cur_desc[1], 0,
(void*)address); (void *)address);
if (address == -1) if (address == -1) {
goto fail; goto fail;
} }
}
} while (blockno); } while (blockno);
return 0; return 0;
@ -220,7 +223,7 @@ static int zipl_run(struct scsi_blockptr *pte)
entry++; entry++;
if ((uint8_t*)(&entry[1]) > (tmp_sec + SECTOR_SIZE)) { if ((uint8_t *)(&entry[1]) > (tmp_sec + SECTOR_SIZE)) {
goto fail; goto fail;
} }
} }
@ -241,7 +244,7 @@ fail:
int zipl_load(void) int zipl_load(void)
{ {
struct mbr *mbr = (void*)sec; struct mbr *mbr = (void *)sec;
uint8_t *ns, *ns_end; uint8_t *ns, *ns_end;
int program_table_entries = 0; int program_table_entries = 0;
int pte_len = sizeof(struct scsi_blockptr); int pte_len = sizeof(struct scsi_blockptr);
@ -249,7 +252,7 @@ int zipl_load(void)
const char *error = ""; const char *error = "";
/* Grab the MBR */ /* Grab the MBR */
virtio_read(0, (void*)mbr); virtio_read(0, (void *)mbr);
dputs("checking magic\n"); dputs("checking magic\n");

View file

@ -88,7 +88,7 @@ static inline void fill_hex(char *out, unsigned char val)
static inline void print_int(const char *desc, u64 addr) 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"; char out[] = ": 0xffffffffffffffff\n";
unsigned int i; unsigned int i;

View file

@ -33,7 +33,7 @@ static int sclp_service_call(unsigned int command, void *sccb)
static void sclp_set_write_mask(void) static void sclp_set_write_mask(void)
{ {
WriteEventMask *sccb = (void*)_sccb; WriteEventMask *sccb = (void *)_sccb;
sccb->h.length = sizeof(WriteEventMask); sccb->h.length = sizeof(WriteEventMask);
sccb->mask_length = sizeof(unsigned int); 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) void sclp_print(const char *str)
{ {
int len = _strlen(str); int len = _strlen(str);
WriteEventData *sccb = (void*)_sccb; WriteEventData *sccb = (void *)_sccb;
sccb->h.length = sizeof(WriteEventData) + len; sccb->h.length = sizeof(WriteEventData) + len;
sccb->h.function_code = SCLP_FC_NORMAL_WRITE; sccb->h.function_code = SCLP_FC_NORMAL_WRITE;

View file

@ -33,7 +33,7 @@ static long kvm_hypercall(unsigned long nr, unsigned long param1,
static void virtio_notify(struct subchannel_id schid) 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);
} }
/*********************************************** /***********************************************
@ -249,7 +249,7 @@ unsigned long virtio_load_direct(ulong rec_list1, ulong rec_list2,
} }
sclp_print("."); sclp_print(".");
status = virtio_read_many(sec, (void*)addr, sec_num); status = virtio_read_many(sec, (void *)addr, sec_num);
if (status) { if (status) {
virtio_panic("I/O Error"); 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))) { if (run_ccw(schid, CCW_CMD_READ_VQ_CONF, &config, sizeof(config))) {
virtio_panic("Could not get block device configuration\n"); 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); KVM_S390_VIRTIO_RING_ALIGN);
info.queue = (100ULL * 1024ULL* 1024ULL); info.queue = (100ULL * 1024ULL* 1024ULL);