summaryrefslogtreecommitdiff
path: root/drivers/s390/char
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2008-04-17 07:46:31 +0200
committerHeiko Carstens <heiko.carstens@de.ibm.com>2008-04-17 07:47:07 +0200
commitca68305bf3c76c4a7cd1c77d5423219f39164df8 (patch)
treedc73a7d9eb53a47d16690e8106a097aa8f601866 /drivers/s390/char
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')
-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)
ASCEBC(ebcdic_name, 8);
}
-/*
- * print appropriate error message for segment_load()/segment_type()
- * return code
- */
-static void mon_segment_warn(int rc, char* seg_name)
-{
- switch (rc) {
- case -ENOENT:
- P_WARNING("cannot load/query segment %s, does not exist\n",
- seg_name);
- break;
- case -ENOSYS:
- P_WARNING("cannot load/query segment %s, not running on VM\n",
- seg_name);
- break;
- case -EIO:
- P_WARNING("cannot load/query segment %s, hardware error\n",
- seg_name);
- break;
- case -ENOTSUPP:
- P_WARNING("cannot load/query segment %s, is a multi-part "
- "segment\n", seg_name);
- break;
- case -ENOSPC:
- P_WARNING("cannot load/query segment %s, overlaps with "
- "storage\n", seg_name);
- break;
- case -EBUSY:
- P_WARNING("cannot load/query segment %s, overlaps with "
- "already loaded dcss\n", seg_name);
- break;
- case -EPERM:
- P_WARNING("cannot load/query segment %s, already loaded in "
- "incompatible mode\n", seg_name);
- break;
- case -ENOMEM:
- P_WARNING("cannot load/query segment %s, out of memory\n",
- seg_name);
- break;
- case -ERANGE:
- P_WARNING("cannot load/query segment %s, exceeds kernel "
- "mapping range\n", seg_name);
- break;
- default:
- P_WARNING("cannot load/query segment %s, return value %i\n",
- seg_name, rc);
- break;
- }
-}
-
static inline unsigned long mon_mca_start(struct mon_msg *monmsg)
{
return *(u32 *) &monmsg->msg.rmmsg;
@@ -585,7 +535,7 @@ static int __init mon_init(void)
rc = segment_type(mon_dcss_name);
if (rc < 0) {
- mon_segment_warn(rc, mon_dcss_name);
+ segment_warning(rc, mon_dcss_name);
goto out_iucv;
}
if (rc != SEG_TYPE_SC) {
@@ -598,7 +548,7 @@ static int __init mon_init(void)
rc = segment_load(mon_dcss_name, SEGMENT_SHARED,
&mon_dcss_start, &mon_dcss_end);
if (rc < 0) {
- mon_segment_warn(rc, mon_dcss_name);
+ segment_warning(rc, mon_dcss_name);
rc = -EINVAL;
goto out_iucv;
}