aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2008-04-17 01:46:26 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2008-04-17 01:47:06 -0400
commita806170e29c5468b1d641a22518243bdf1b8d58b (patch)
tree0b1661f287d6e2b711bbd7600120a250a4f57549 /drivers/s390
parent5a62b192196af9a798e2f2f4c6a1324e7edf2f4b (diff)
[S390] Fix a lot of sparse warnings.
Most noteable part of this commit is the new local header file entry.h which contains all the function declarations of functions that get only called from asm code or are arch internal. That way we can avoid extern declarations in C files. This is more or less the same that was done for sparc64. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/dasd.c5
-rw-r--r--drivers/s390/block/dasd_alias.c49
-rw-r--r--drivers/s390/cio/cio.c18
-rw-r--r--drivers/s390/cio/cio.h1
-rw-r--r--drivers/s390/cio/device.c1
-rw-r--r--drivers/s390/cio/device.h1
-rw-r--r--drivers/s390/s390mach.h4
7 files changed, 40 insertions, 39 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index bb72e0a5b0e0..ac6d4d3218b3 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -2299,9 +2299,8 @@ int dasd_generic_set_offline(struct ccw_device *cdev)
2299 * in the other openers. 2299 * in the other openers.
2300 */ 2300 */
2301 if (device->block) { 2301 if (device->block) {
2302 struct dasd_block *block = device->block; 2302 max_count = device->block->bdev ? 0 : -1;
2303 max_count = block->bdev ? 0 : -1; 2303 open_count = atomic_read(&device->block->open_count);
2304 open_count = (int) atomic_read(&block->open_count);
2305 if (open_count > max_count) { 2304 if (open_count > max_count) {
2306 if (open_count > 0) 2305 if (open_count > 0)
2307 printk(KERN_WARNING "Can't offline dasd " 2306 printk(KERN_WARNING "Can't offline dasd "
diff --git a/drivers/s390/block/dasd_alias.c b/drivers/s390/block/dasd_alias.c
index 3a40bee9d358..2d8df0b30538 100644
--- a/drivers/s390/block/dasd_alias.c
+++ b/drivers/s390/block/dasd_alias.c
@@ -745,6 +745,19 @@ static void flush_all_alias_devices_on_lcu(struct alias_lcu *lcu)
745 spin_unlock_irqrestore(&lcu->lock, flags); 745 spin_unlock_irqrestore(&lcu->lock, flags);
746} 746}
747 747
748static void __stop_device_on_lcu(struct dasd_device *device,
749 struct dasd_device *pos)
750{
751 /* If pos == device then device is already locked! */
752 if (pos == device) {
753 pos->stopped |= DASD_STOPPED_SU;
754 return;
755 }
756 spin_lock(get_ccwdev_lock(pos->cdev));
757 pos->stopped |= DASD_STOPPED_SU;
758 spin_unlock(get_ccwdev_lock(pos->cdev));
759}
760
748/* 761/*
749 * This function is called in interrupt context, so the 762 * This function is called in interrupt context, so the
750 * cdev lock for device is already locked! 763 * cdev lock for device is already locked!
@@ -755,35 +768,15 @@ static void _stop_all_devices_on_lcu(struct alias_lcu *lcu,
755 struct alias_pav_group *pavgroup; 768 struct alias_pav_group *pavgroup;
756 struct dasd_device *pos; 769 struct dasd_device *pos;
757 770
758 list_for_each_entry(pos, &lcu->active_devices, alias_list) { 771 list_for_each_entry(pos, &lcu->active_devices, alias_list)
759 if (pos != device) 772 __stop_device_on_lcu(device, pos);
760 spin_lock(get_ccwdev_lock(pos->cdev)); 773 list_for_each_entry(pos, &lcu->inactive_devices, alias_list)
761 pos->stopped |= DASD_STOPPED_SU; 774 __stop_device_on_lcu(device, pos);
762 if (pos != device)
763 spin_unlock(get_ccwdev_lock(pos->cdev));
764 }
765 list_for_each_entry(pos, &lcu->inactive_devices, alias_list) {
766 if (pos != device)
767 spin_lock(get_ccwdev_lock(pos->cdev));
768 pos->stopped |= DASD_STOPPED_SU;
769 if (pos != device)
770 spin_unlock(get_ccwdev_lock(pos->cdev));
771 }
772 list_for_each_entry(pavgroup, &lcu->grouplist, group) { 775 list_for_each_entry(pavgroup, &lcu->grouplist, group) {
773 list_for_each_entry(pos, &pavgroup->baselist, alias_list) { 776 list_for_each_entry(pos, &pavgroup->baselist, alias_list)
774 if (pos != device) 777 __stop_device_on_lcu(device, pos);
775 spin_lock(get_ccwdev_lock(pos->cdev)); 778 list_for_each_entry(pos, &pavgroup->aliaslist, alias_list)
776 pos->stopped |= DASD_STOPPED_SU; 779 __stop_device_on_lcu(device, pos);
777 if (pos != device)
778 spin_unlock(get_ccwdev_lock(pos->cdev));
779 }
780 list_for_each_entry(pos, &pavgroup->aliaslist, alias_list) {
781 if (pos != device)
782 spin_lock(get_ccwdev_lock(pos->cdev));
783 pos->stopped |= DASD_STOPPED_SU;
784 if (pos != device)
785 spin_unlock(get_ccwdev_lock(pos->cdev));
786 }
787 } 780 }
788} 781}
789 782
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index 41db3cc653f5..23ffcc4768a7 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -670,10 +670,14 @@ do_IRQ (struct pt_regs *regs)
670 continue; 670 continue;
671 } 671 }
672 sch = (struct subchannel *)(unsigned long)tpi_info->intparm; 672 sch = (struct subchannel *)(unsigned long)tpi_info->intparm;
673 if (sch) 673 if (!sch) {
674 spin_lock(sch->lock); 674 /* Clear pending interrupt condition. */
675 tsch(tpi_info->schid, irb);
676 continue;
677 }
678 spin_lock(sch->lock);
675 /* Store interrupt response block to lowcore. */ 679 /* Store interrupt response block to lowcore. */
676 if (tsch (tpi_info->schid, irb) == 0 && sch) { 680 if (tsch(tpi_info->schid, irb) == 0) {
677 /* Keep subchannel information word up to date. */ 681 /* Keep subchannel information word up to date. */
678 memcpy (&sch->schib.scsw, &irb->scsw, 682 memcpy (&sch->schib.scsw, &irb->scsw,
679 sizeof (irb->scsw)); 683 sizeof (irb->scsw));
@@ -681,8 +685,7 @@ do_IRQ (struct pt_regs *regs)
681 if (sch->driver && sch->driver->irq) 685 if (sch->driver && sch->driver->irq)
682 sch->driver->irq(sch); 686 sch->driver->irq(sch);
683 } 687 }
684 if (sch) 688 spin_unlock(sch->lock);
685 spin_unlock(sch->lock);
686 /* 689 /*
687 * Are more interrupts pending? 690 * Are more interrupts pending?
688 * If so, the tpi instruction will update the lowcore 691 * If so, the tpi instruction will update the lowcore
@@ -708,8 +711,9 @@ void *cio_get_console_priv(void)
708/* 711/*
709 * busy wait for the next interrupt on the console 712 * busy wait for the next interrupt on the console
710 */ 713 */
711void 714void wait_cons_dev(void)
712wait_cons_dev (void) 715 __releases(console_subchannel.lock)
716 __acquires(console_subchannel.lock)
713{ 717{
714 unsigned long cr6 __attribute__ ((aligned (8))); 718 unsigned long cr6 __attribute__ ((aligned (8)));
715 unsigned long save_cr6 __attribute__ ((aligned (8))); 719 unsigned long save_cr6 __attribute__ ((aligned (8)));
diff --git a/drivers/s390/cio/cio.h b/drivers/s390/cio/cio.h
index 52afa4c784de..08f2235c5a6f 100644
--- a/drivers/s390/cio/cio.h
+++ b/drivers/s390/cio/cio.h
@@ -100,6 +100,7 @@ extern int cio_modify (struct subchannel *);
100 100
101int cio_create_sch_lock(struct subchannel *); 101int cio_create_sch_lock(struct subchannel *);
102void do_adapter_IO(void); 102void do_adapter_IO(void);
103void do_IRQ(struct pt_regs *);
103 104
104/* Use with care. */ 105/* Use with care. */
105#ifdef CONFIG_CCW_CONSOLE 106#ifdef CONFIG_CCW_CONSOLE
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index fec004f62bcf..e0c7adb8958e 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -577,7 +577,6 @@ static DEVICE_ATTR(devtype, 0444, devtype_show, NULL);
577static DEVICE_ATTR(cutype, 0444, cutype_show, NULL); 577static DEVICE_ATTR(cutype, 0444, cutype_show, NULL);
578static DEVICE_ATTR(modalias, 0444, modalias_show, NULL); 578static DEVICE_ATTR(modalias, 0444, modalias_show, NULL);
579static DEVICE_ATTR(online, 0644, online_show, online_store); 579static DEVICE_ATTR(online, 0644, online_show, online_store);
580extern struct device_attribute dev_attr_cmb_enable;
581static DEVICE_ATTR(availability, 0444, available_show, NULL); 580static DEVICE_ATTR(availability, 0444, available_show, NULL);
582 581
583static struct attribute * subch_attrs[] = { 582static struct attribute * subch_attrs[] = {
diff --git a/drivers/s390/cio/device.h b/drivers/s390/cio/device.h
index d40a2ffaa000..cb08092be39f 100644
--- a/drivers/s390/cio/device.h
+++ b/drivers/s390/cio/device.h
@@ -127,4 +127,5 @@ extern struct bus_type ccw_bus_type;
127void retry_set_schib(struct ccw_device *cdev); 127void retry_set_schib(struct ccw_device *cdev);
128void cmf_retry_copy_block(struct ccw_device *); 128void cmf_retry_copy_block(struct ccw_device *);
129int cmf_reenable(struct ccw_device *); 129int cmf_reenable(struct ccw_device *);
130extern struct device_attribute dev_attr_cmb_enable;
130#endif 131#endif
diff --git a/drivers/s390/s390mach.h b/drivers/s390/s390mach.h
index d3ca4281a494..ca681f9b67fc 100644
--- a/drivers/s390/s390mach.h
+++ b/drivers/s390/s390mach.h
@@ -105,4 +105,8 @@ static inline int stcrw(struct crw *pcrw )
105#define ED_ETR_SYNC 12 /* External damage ETR sync check */ 105#define ED_ETR_SYNC 12 /* External damage ETR sync check */
106#define ED_ETR_SWITCH 13 /* External damage ETR switch to local */ 106#define ED_ETR_SWITCH 13 /* External damage ETR switch to local */
107 107
108struct pt_regs;
109
110void s390_handle_mcck(void);
111void s390_do_machine_check(struct pt_regs *regs);
108#endif /* __s390mach */ 112#endif /* __s390mach */