提交 e510f681 编写于 作者: P Pierre Morel 提交者: Martin Schwidefsky

s390/cio: de-duplicate subchannel validation

cio_validate_io_subchannel() and cio_validate_msg_subchannel() are
identical, as the called functions already take care about the
differences between subchannel types.

Just inline the code into the only user,
cio_validate_subchannel(), instead.
Signed-off-by: NPierre Morel <pmorel@linux.vnet.ibm.com>
Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: NSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 8f0ba831
...@@ -476,26 +476,6 @@ static int cio_check_devno_blacklisted(struct subchannel *sch) ...@@ -476,26 +476,6 @@ static int cio_check_devno_blacklisted(struct subchannel *sch)
return 0; return 0;
} }
static int cio_validate_io_subchannel(struct subchannel *sch)
{
/* Initialization for io subchannels. */
if (!css_sch_is_valid(&sch->schib))
return -ENODEV;
/* Devno is valid. */
return cio_check_devno_blacklisted(sch);
}
static int cio_validate_msg_subchannel(struct subchannel *sch)
{
/* Initialization for message subchannels. */
if (!css_sch_is_valid(&sch->schib))
return -ENODEV;
/* Devno is valid. */
return cio_check_devno_blacklisted(sch);
}
/** /**
* cio_validate_subchannel - basic validation of subchannel * cio_validate_subchannel - basic validation of subchannel
* @sch: subchannel structure to be filled out * @sch: subchannel structure to be filled out
...@@ -533,10 +513,11 @@ int cio_validate_subchannel(struct subchannel *sch, struct subchannel_id schid) ...@@ -533,10 +513,11 @@ int cio_validate_subchannel(struct subchannel *sch, struct subchannel_id schid)
switch (sch->st) { switch (sch->st) {
case SUBCHANNEL_TYPE_IO: case SUBCHANNEL_TYPE_IO:
err = cio_validate_io_subchannel(sch);
break;
case SUBCHANNEL_TYPE_MSG: case SUBCHANNEL_TYPE_MSG:
err = cio_validate_msg_subchannel(sch); if (!css_sch_is_valid(&sch->schib))
err = -ENODEV;
else
err = cio_check_devno_blacklisted(sch);
break; break;
default: default:
err = 0; err = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册