Commit d96d6867 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Linus Torvalds

[PATCH] s390: dasd driver coding style (1/2)

s390 dasd driver:
 - Coding style adaptions. Removed almost all typedefs from the dasd driver.
parent 616dea43
This diff is collapsed.
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000
* *
* $Revision: 1.7 $ * $Revision: 1.9 $
*
* History of changes
*
*/ */
#define PRINTK_HEADER "dasd_erp(3370)" #define PRINTK_HEADER "dasd_erp(3370)"
...@@ -32,7 +29,7 @@ ...@@ -32,7 +29,7 @@
* dasd_era_recover for all others. * dasd_era_recover for all others.
*/ */
dasd_era_t dasd_era_t
dasd_3370_erp_examine(dasd_ccw_req_t * cqr, struct irb * irb) dasd_3370_erp_examine(struct dasd_ccw_req * cqr, struct irb * irb)
{ {
char *sense = irb->ecw; char *sense = irb->ecw;
......
This diff is collapsed.
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000
* *
* $Revision: 1.6 $ * $Revision: 1.8 $
*
* History of changes
*
*/ */
#define PRINTK_HEADER "dasd_erp(9336)" #define PRINTK_HEADER "dasd_erp(9336)"
...@@ -32,7 +29,7 @@ ...@@ -32,7 +29,7 @@
* dasd_era_recover for all others. * dasd_era_recover for all others.
*/ */
dasd_era_t dasd_era_t
dasd_9336_erp_examine(dasd_ccw_req_t * cqr, struct irb * irb) dasd_9336_erp_examine(struct dasd_ccw_req * cqr, struct irb * irb)
{ {
/* check for successful execution first */ /* check for successful execution first */
if (irb->scsw.cstat == 0x00 && if (irb->scsw.cstat == 0x00 &&
......
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000
* *
* $Revision: 1.11 $ * $Revision: 1.13 $
*
* History of changes
*
*/ */
#define PRINTK_HEADER "dasd_erp(9343)" #define PRINTK_HEADER "dasd_erp(9343)"
...@@ -15,7 +12,7 @@ ...@@ -15,7 +12,7 @@
#include "dasd_int.h" #include "dasd_int.h"
dasd_era_t dasd_era_t
dasd_9343_erp_examine(dasd_ccw_req_t * cqr, struct irb * irb) dasd_9343_erp_examine(struct dasd_ccw_req * cqr, struct irb * irb)
{ {
if (irb->scsw.cstat == 0x00 && if (irb->scsw.cstat == 0x00 &&
irb->scsw.dstat == (DEV_STAT_CHN_END | DEV_STAT_DEV_END)) irb->scsw.dstat == (DEV_STAT_CHN_END | DEV_STAT_DEV_END))
......
...@@ -11,14 +11,10 @@ ...@@ -11,14 +11,10 @@
* functions may not be called from interrupt context. In particular * functions may not be called from interrupt context. In particular
* dasd_get_device is a no-no from interrupt context. * dasd_get_device is a no-no from interrupt context.
* *
* $Revision: 1.12 $ * $Revision: 1.15 $
*
* History of changes
* 05/04/02 split from dasd.c, code restructuring.
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/version.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -40,14 +36,14 @@ ...@@ -40,14 +36,14 @@
* can be removed since the device number will then be identical * can be removed since the device number will then be identical
* to the device index. * to the device index.
*/ */
typedef struct { struct dasd_devmap {
struct list_head devindex_list; struct list_head devindex_list;
struct list_head devno_list; struct list_head devno_list;
unsigned int devindex; unsigned int devindex;
unsigned short devno; unsigned short devno;
unsigned short features; unsigned short features;
dasd_device_t *device; struct dasd_device *device;
} dasd_devmap_t; };
/* /*
* Parameter parsing functions for dasd= parameter. The syntax is: * Parameter parsing functions for dasd= parameter. The syntax is:
...@@ -264,13 +260,12 @@ dasd_add_range(int from, int to, int features) ...@@ -264,13 +260,12 @@ dasd_add_range(int from, int to, int features)
} }
spin_lock(&dasd_devmap_lock); spin_lock(&dasd_devmap_lock);
for (devno = from; devno <= to; devno++) { for (devno = from; devno <= to; devno++) {
dasd_devmap_t *devmap, *tmp; struct dasd_devmap *devmap, *tmp;
struct list_head *l;
devmap = NULL; devmap = NULL;
/* Find previous devmap for device number i */ /* Find previous devmap for device number i */
list_for_each(l, &dasd_devno_hashlists[devno & 255]) { list_for_each_entry(tmp, &dasd_devno_hashlists[devno & 255],
tmp = list_entry(l, dasd_devmap_t, devno_list); devno_list) {
if (tmp->devno == devno) { if (tmp->devno == devno) {
devmap = tmp; devmap = tmp;
break; break;
...@@ -278,8 +273,8 @@ dasd_add_range(int from, int to, int features) ...@@ -278,8 +273,8 @@ dasd_add_range(int from, int to, int features)
} }
if (devmap == NULL) { if (devmap == NULL) {
/* This devno is new. */ /* This devno is new. */
devmap = (dasd_devmap_t *) devmap = (struct dasd_devmap *)
kmalloc(sizeof(dasd_devmap_t), GFP_KERNEL); kmalloc(sizeof(struct dasd_devmap),GFP_KERNEL);
if (devmap == NULL) if (devmap == NULL)
return -ENOMEM; return -ENOMEM;
devindex = dasd_max_devindex++; devindex = dasd_max_devindex++;
...@@ -303,14 +298,15 @@ dasd_add_range(int from, int to, int features) ...@@ -303,14 +298,15 @@ dasd_add_range(int from, int to, int features)
int int
dasd_devno_in_range(int devno) dasd_devno_in_range(int devno)
{ {
struct list_head *l; struct dasd_devmap *devmap;
int ret; int ret;
ret = -ENOENT; ret = -ENOENT;
spin_lock(&dasd_devmap_lock); spin_lock(&dasd_devmap_lock);
/* Find devmap for device with device number devno */ /* Find devmap for device with device number devno */
list_for_each(l, &dasd_devno_hashlists[devno&255]) { list_for_each_entry(devmap, &dasd_devno_hashlists[devno&255],
if (list_entry(l, dasd_devmap_t, devno_list)->devno == devno) { devno_list) {
if (devmap->devno == devno) {
/* Found the device. */ /* Found the device. */
ret = 0; ret = 0;
break; break;
...@@ -332,9 +328,9 @@ dasd_forget_ranges(void) ...@@ -332,9 +328,9 @@ dasd_forget_ranges(void)
spin_lock(&dasd_devmap_lock); spin_lock(&dasd_devmap_lock);
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {
struct list_head *l, *next; struct list_head *l, *next;
dasd_devmap_t *devmap; struct dasd_devmap *devmap;
list_for_each_safe(l, next, &dasd_devno_hashlists[i]) { list_for_each_safe(l, next, &dasd_devno_hashlists[i]) {
devmap = list_entry(l, dasd_devmap_t, devno_list); devmap = list_entry(l, struct dasd_devmap, devno_list);
if (devmap->device != NULL) if (devmap->device != NULL)
BUG(); BUG();
list_del(&devmap->devindex_list); list_del(&devmap->devindex_list);
...@@ -349,17 +345,15 @@ dasd_forget_ranges(void) ...@@ -349,17 +345,15 @@ dasd_forget_ranges(void)
* Find the devmap structure from a devno. Can be removed as soon * Find the devmap structure from a devno. Can be removed as soon
* as big minors are available. * as big minors are available.
*/ */
static dasd_devmap_t * static struct dasd_devmap *
dasd_devmap_from_devno(int devno) dasd_devmap_from_devno(int devno)
{ {
struct list_head *l; struct dasd_devmap *devmap, *tmp;
dasd_devmap_t *devmap, *tmp;
devmap = NULL; devmap = NULL;
spin_lock(&dasd_devmap_lock); spin_lock(&dasd_devmap_lock);
/* Find devmap for device with device number devno */ /* Find devmap for device with device number devno */
list_for_each(l, &dasd_devno_hashlists[devno&255]) { list_for_each_entry(tmp, &dasd_devno_hashlists[devno&255], devno_list) {
tmp = list_entry(l, dasd_devmap_t, devno_list);
if (tmp->devno == devno) { if (tmp->devno == devno) {
/* Found the device, return devmap */ /* Found the device, return devmap */
devmap = tmp; devmap = tmp;
...@@ -374,17 +368,16 @@ dasd_devmap_from_devno(int devno) ...@@ -374,17 +368,16 @@ dasd_devmap_from_devno(int devno)
* Find the devmap for a device by its device index. Can be removed * Find the devmap for a device by its device index. Can be removed
* as soon as big minors are available. * as soon as big minors are available.
*/ */
static dasd_devmap_t * static struct dasd_devmap *
dasd_devmap_from_devindex(int devindex) dasd_devmap_from_devindex(int devindex)
{ {
struct list_head *l; struct dasd_devmap *devmap, *tmp;
dasd_devmap_t *devmap, *tmp;
devmap = NULL; devmap = NULL;
spin_lock(&dasd_devmap_lock); spin_lock(&dasd_devmap_lock);
/* Find devmap for device with device index devindex */ /* Find devmap for device with device index devindex */
list_for_each(l, &dasd_devindex_hashlists[devindex & 255]) { list_for_each_entry(tmp, &dasd_devindex_hashlists[devindex & 255],
tmp = list_entry(l, dasd_devmap_t, devindex_list); devindex_list) {
if (tmp->devindex == devindex) { if (tmp->devindex == devindex) {
/* Found the device, return devno */ /* Found the device, return devno */
devmap = tmp; devmap = tmp;
...@@ -395,11 +388,11 @@ dasd_devmap_from_devindex(int devindex) ...@@ -395,11 +388,11 @@ dasd_devmap_from_devindex(int devindex)
return devmap; return devmap;
} }
dasd_device_t * struct dasd_device *
dasd_device_from_devindex(int devindex) dasd_device_from_devindex(int devindex)
{ {
dasd_devmap_t *devmap; struct dasd_devmap *devmap;
dasd_device_t *device; struct dasd_device *device;
devmap = dasd_devmap_from_devindex(devindex); devmap = dasd_devmap_from_devindex(devindex);
spin_lock(&dasd_devmap_lock); spin_lock(&dasd_devmap_lock);
...@@ -416,9 +409,9 @@ dasd_device_from_devindex(int devindex) ...@@ -416,9 +409,9 @@ dasd_device_from_devindex(int devindex)
* Return kdev for a dasd device. * Return kdev for a dasd device.
*/ */
kdev_t kdev_t
dasd_get_kdev(dasd_device_t *device) dasd_get_kdev(struct dasd_device *device)
{ {
dasd_devmap_t *devmap; struct dasd_devmap *devmap;
int major, minor; int major, minor;
int devno; int devno;
...@@ -436,11 +429,11 @@ dasd_get_kdev(dasd_device_t *device) ...@@ -436,11 +429,11 @@ dasd_get_kdev(dasd_device_t *device)
/* /*
* Create a dasd device structure for cdev. * Create a dasd device structure for cdev.
*/ */
dasd_device_t * struct dasd_device *
dasd_create_device(struct ccw_device *cdev) dasd_create_device(struct ccw_device *cdev)
{ {
dasd_devmap_t *devmap; struct dasd_devmap *devmap;
dasd_device_t *device; struct dasd_device *device;
int devno; int devno;
int rc; int rc;
...@@ -491,10 +484,10 @@ static DECLARE_WAIT_QUEUE_HEAD(dasd_delete_wq); ...@@ -491,10 +484,10 @@ static DECLARE_WAIT_QUEUE_HEAD(dasd_delete_wq);
* Remove a dasd device structure. * Remove a dasd device structure.
*/ */
void void
dasd_delete_device(dasd_device_t *device) dasd_delete_device(struct dasd_device *device)
{ {
struct ccw_device *cdev; struct ccw_device *cdev;
dasd_devmap_t *devmap; struct dasd_devmap *devmap;
int devno; int devno;
/* First remove device pointer from devmap. */ /* First remove device pointer from devmap. */
...@@ -526,7 +519,7 @@ dasd_delete_device(dasd_device_t *device) ...@@ -526,7 +519,7 @@ dasd_delete_device(dasd_device_t *device)
* in dasd_delete_device. * in dasd_delete_device.
*/ */
void void
dasd_put_device_wake(dasd_device_t *device) dasd_put_device_wake(struct dasd_device *device)
{ {
wake_up(&dasd_delete_wq); wake_up(&dasd_delete_wq);
} }
......
This diff is collapsed.
...@@ -6,10 +6,7 @@ ...@@ -6,10 +6,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
* *
* $Revision: 1.4 $ * $Revision: 1.6 $
*
* History of changes
*
*/ */
#define MDSK_WRITE_REQ 0x01 #define MDSK_WRITE_REQ 0x01
...@@ -22,7 +19,7 @@ ...@@ -22,7 +19,7 @@
#define DEV_CLASS_FBA 0x01 #define DEV_CLASS_FBA 0x01
#define DEV_CLASS_ECKD 0x04 #define DEV_CLASS_ECKD 0x04
typedef struct dasd_diag_characteristics_t { struct dasd_diag_characteristics {
u16 dev_nr; u16 dev_nr;
u16 rdc_len; u16 rdc_len;
u8 vdev_class; u8 vdev_class;
...@@ -33,22 +30,18 @@ typedef struct dasd_diag_characteristics_t { ...@@ -33,22 +30,18 @@ typedef struct dasd_diag_characteristics_t {
u8 rdev_type; u8 rdev_type;
u8 rdev_model; u8 rdev_model;
u8 rdev_features; u8 rdev_features;
} __attribute__ ((packed, aligned(4))) } __attribute__ ((packed, aligned(4)));
dasd_diag_characteristics_t;
typedef struct diag_bio_t { struct dasd_diag_bio {
u8 type; u8 type;
u8 status; u8 status;
u16 spare1; u16 spare1;
u32 block_number; u32 block_number;
u32 alet; u32 alet;
u32 buffer; u32 buffer;
} __attribute__ ((packed, aligned(8))) } __attribute__ ((packed, aligned(8)));
diag_bio_t; struct dasd_diag_init_io {
typedef struct diag_init_io_t {
u16 dev_nr; u16 dev_nr;
u16 spare1[11]; u16 spare1[11];
u32 block_size; u32 block_size;
...@@ -56,11 +49,9 @@ typedef struct diag_init_io_t { ...@@ -56,11 +49,9 @@ typedef struct diag_init_io_t {
u32 start_block; u32 start_block;
u32 end_block; u32 end_block;
u32 spare2[6]; u32 spare2[6];
} __attribute__ ((packed, aligned(8))) } __attribute__ ((packed, aligned(8)));
diag_init_io_t;
typedef struct diag_rw_io_t { struct dasd_diag_rw_io {
u16 dev_nr; u16 dev_nr;
u16 spare1[11]; u16 spare1[11];
u8 key; u8 key;
...@@ -71,7 +62,5 @@ typedef struct diag_rw_io_t { ...@@ -71,7 +62,5 @@ typedef struct diag_rw_io_t {
u32 bio_list; u32 bio_list;
u32 interrupt_params; u32 interrupt_params;
u32 spare3[5]; u32 spare3[5];
} __attribute__ ((packed, aligned(8))) } __attribute__ ((packed, aligned(8)));
diag_rw_io_t;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment