aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/monreader.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2008-04-17 01:46:31 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2008-04-17 01:47:07 -0400
commitca68305bf3c76c4a7cd1c77d5423219f39164df8 (patch)
treedc73a7d9eb53a47d16690e8106a097aa8f601866 /drivers/s390/char/monreader.c
parent9e74a6b8983c2653dd2a6f51e634efa281e95d59 (diff)
[S390] Remove code duplication from monreader / dcssblk.
Move the function that prints the segment warning messages found in the monreader driver and the dcssblk driver to the extmem base code. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390/char/monreader.c')
-rw-r--r--drivers/s390/char/monreader.c54
1 files changed, 2 insertions, 52 deletions
diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c
index 67009bfa093e..1e1f50655bbf 100644
--- a/drivers/s390/char/monreader.c
+++ b/drivers/s390/char/monreader.c
@@ -111,56 +111,6 @@ static void dcss_mkname(char *ascii_name, char *ebcdic_name)
111 ASCEBC(ebcdic_name, 8); 111 ASCEBC(ebcdic_name, 8);
112} 112}
113 113
114/*
115 * print appropriate error message for segment_load()/segment_type()
116 * return code
117 */
118static void mon_segment_warn(int rc, char* seg_name)
119{
120 switch (rc) {
121 case -ENOENT:
122 P_WARNING("cannot load/query segment %s, does not exist\n",
123 seg_name);
124 break;
125 case -ENOSYS:
126 P_WARNING("cannot load/query segment %s, not running on VM\n",
127 seg_name);
128 break;
129 case -EIO:
130 P_WARNING("cannot load/query segment %s, hardware error\n",
131 seg_name);
132 break;
133 case -ENOTSUPP:
134 P_WARNING("cannot load/query segment %s, is a multi-part "
135 "segment\n", seg_name);
136 break;
137 case -ENOSPC:
138 P_WARNING("cannot load/query segment %s, overlaps with "
139 "storage\n", seg_name);
140 break;
141 case -EBUSY:
142 P_WARNING("cannot load/query segment %s, overlaps with "
143 "already loaded dcss\n", seg_name);
144 break;
145 case -EPERM:
146 P_WARNING("cannot load/query segment %s, already loaded in "
147 "incompatible mode\n", seg_name);
148 break;
149 case -ENOMEM:
150 P_WARNING("cannot load/query segment %s, out of memory\n",
151 seg_name);
152 break;
153 case -ERANGE:
154 P_WARNING("cannot load/query segment %s, exceeds kernel "
155 "mapping range\n", seg_name);
156 break;
157 default:
158 P_WARNING("cannot load/query segment %s, return value %i\n",
159 seg_name, rc);
160 break;
161 }
162}
163
164static inline unsigned long mon_mca_start(struct mon_msg *monmsg) 114static inline unsigned long mon_mca_start(struct mon_msg *monmsg)
165{ 115{
166 return *(u32 *) &monmsg->msg.rmmsg; 116 return *(u32 *) &monmsg->msg.rmmsg;
@@ -585,7 +535,7 @@ static int __init mon_init(void)
585 535
586 rc = segment_type(mon_dcss_name); 536 rc = segment_type(mon_dcss_name);
587 if (rc < 0) { 537 if (rc < 0) {
588 mon_segment_warn(rc, mon_dcss_name); 538 segment_warning(rc, mon_dcss_name);
589 goto out_iucv; 539 goto out_iucv;
590 } 540 }
591 if (rc != SEG_TYPE_SC) { 541 if (rc != SEG_TYPE_SC) {
@@ -598,7 +548,7 @@ static int __init mon_init(void)
598 rc = segment_load(mon_dcss_name, SEGMENT_SHARED, 548 rc = segment_load(mon_dcss_name, SEGMENT_SHARED,
599 &mon_dcss_start, &mon_dcss_end); 549 &mon_dcss_start, &mon_dcss_end);
600 if (rc < 0) { 550 if (rc < 0) {
601 mon_segment_warn(rc, mon_dcss_name); 551 segment_warning(rc, mon_dcss_name);
602 rc = -EINVAL; 552 rc = -EINVAL;
603 goto out_iucv; 553 goto out_iucv;
604 } 554 }