diff options
author | Jan Glauber <jang@linux.vnet.ibm.com> | 2009-06-12 04:26:28 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-06-12 04:27:32 -0400 |
commit | 4c57542320e73b9ff46b04092273dbcc184a4fb6 (patch) | |
tree | 981cca8580a6cd0447f38525fef1a84a4bb7dfd4 /drivers | |
parent | e45efa99b0b0035a2afc192c242e37eec5477497 (diff) |
[S390] qdio: simplify error handling in irq handler
The check for the device status in qdio_establish_handle_irq()
had dead code. Remove the unused code and simplify the error
handling.
Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/cio/qdio_main.c | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c index accd957454e7..ba4facc37011 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c | |||
@@ -881,42 +881,26 @@ no_handler: | |||
881 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_STOPPED); | 881 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_STOPPED); |
882 | } | 882 | } |
883 | 883 | ||
884 | static int qdio_establish_check_errors(struct ccw_device *cdev, int cstat, | 884 | static void qdio_establish_handle_irq(struct ccw_device *cdev, int cstat, |
885 | int dstat) | 885 | int dstat) |
886 | { | 886 | { |
887 | struct qdio_irq *irq_ptr = cdev->private->qdio_data; | 887 | struct qdio_irq *irq_ptr = cdev->private->qdio_data; |
888 | 888 | ||
889 | if (cstat || (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END))) { | 889 | DBF_DEV_EVENT(DBF_INFO, irq_ptr, "qest irq"); |
890 | DBF_ERROR("EQ:ck con"); | ||
891 | goto error; | ||
892 | } | ||
893 | 890 | ||
894 | if (!(dstat & DEV_STAT_DEV_END)) { | 891 | if (cstat) |
895 | DBF_ERROR("EQ:no dev"); | ||
896 | goto error; | 892 | goto error; |
897 | } | 893 | if (dstat & ~(DEV_STAT_DEV_END | DEV_STAT_CHN_END)) |
898 | |||
899 | if (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) { | ||
900 | DBF_ERROR("EQ: bad io"); | ||
901 | goto error; | 894 | goto error; |
902 | } | 895 | if (!(dstat & DEV_STAT_DEV_END)) |
903 | return 0; | 896 | goto error; |
897 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ESTABLISHED); | ||
898 | return; | ||
899 | |||
904 | error: | 900 | error: |
905 | DBF_ERROR("%4x EQ:error", irq_ptr->schid.sch_no); | 901 | DBF_ERROR("%4x EQ:error", irq_ptr->schid.sch_no); |
906 | DBF_ERROR("ds: %2x cs:%2x", dstat, cstat); | 902 | DBF_ERROR("ds: %2x cs:%2x", dstat, cstat); |
907 | |||
908 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ERR); | 903 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ERR); |
909 | return 1; | ||
910 | } | ||
911 | |||
912 | static void qdio_establish_handle_irq(struct ccw_device *cdev, int cstat, | ||
913 | int dstat) | ||
914 | { | ||
915 | struct qdio_irq *irq_ptr = cdev->private->qdio_data; | ||
916 | |||
917 | DBF_DEV_EVENT(DBF_INFO, irq_ptr, "qest irq"); | ||
918 | if (!qdio_establish_check_errors(cdev, cstat, dstat)) | ||
919 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ESTABLISHED); | ||
920 | } | 904 | } |
921 | 905 | ||
922 | /* qdio interrupt handler */ | 906 | /* qdio interrupt handler */ |
@@ -946,7 +930,6 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, | |||
946 | } | 930 | } |
947 | } | 931 | } |
948 | qdio_irq_check_sense(irq_ptr, irb); | 932 | qdio_irq_check_sense(irq_ptr, irb); |
949 | |||
950 | cstat = irb->scsw.cmd.cstat; | 933 | cstat = irb->scsw.cmd.cstat; |
951 | dstat = irb->scsw.cmd.dstat; | 934 | dstat = irb->scsw.cmd.dstat; |
952 | 935 | ||
@@ -954,22 +937,19 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, | |||
954 | case QDIO_IRQ_STATE_INACTIVE: | 937 | case QDIO_IRQ_STATE_INACTIVE: |
955 | qdio_establish_handle_irq(cdev, cstat, dstat); | 938 | qdio_establish_handle_irq(cdev, cstat, dstat); |
956 | break; | 939 | break; |
957 | |||
958 | case QDIO_IRQ_STATE_CLEANUP: | 940 | case QDIO_IRQ_STATE_CLEANUP: |
959 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE); | 941 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE); |
960 | break; | 942 | break; |
961 | |||
962 | case QDIO_IRQ_STATE_ESTABLISHED: | 943 | case QDIO_IRQ_STATE_ESTABLISHED: |
963 | case QDIO_IRQ_STATE_ACTIVE: | 944 | case QDIO_IRQ_STATE_ACTIVE: |
964 | if (cstat & SCHN_STAT_PCI) { | 945 | if (cstat & SCHN_STAT_PCI) { |
965 | qdio_int_handler_pci(irq_ptr); | 946 | qdio_int_handler_pci(irq_ptr); |
966 | return; | 947 | return; |
967 | } | 948 | } |
968 | if ((cstat & ~SCHN_STAT_PCI) || dstat) { | 949 | if (cstat || dstat) |
969 | qdio_handle_activate_check(cdev, intparm, cstat, | 950 | qdio_handle_activate_check(cdev, intparm, cstat, |
970 | dstat); | 951 | dstat); |
971 | break; | 952 | break; |
972 | } | ||
973 | default: | 953 | default: |
974 | WARN_ON(1); | 954 | WARN_ON(1); |
975 | } | 955 | } |