Skip to content

Commit

Permalink
11719 timod: cast between incompatible function types
Browse files Browse the repository at this point in the history
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
Reviewed by: Marcel Telka <marcel@telka.sk>
Approved by: Dan McDonald <danmcd@joyent.com>
  • Loading branch information
tsoome committed Sep 30, 2019
1 parent e10751a commit 6caf82f
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions usr/src/uts/common/io/timod.c
Expand Up @@ -311,10 +311,10 @@ int dotilog = 0;

static int timodopen(queue_t *, dev_t *, int, int, cred_t *);
static int timodclose(queue_t *, int, cred_t *);
static void timodwput(queue_t *, mblk_t *);
static void timodrput(queue_t *, mblk_t *);
static void timodrsrv(queue_t *);
static void timodwsrv(queue_t *);
static int timodwput(queue_t *, mblk_t *);
static int timodrput(queue_t *, mblk_t *);
static int timodrsrv(queue_t *);
static int timodwsrv(queue_t *);
static int timodrproc(queue_t *, mblk_t *);
static int timodwproc(queue_t *, mblk_t *);

Expand All @@ -323,17 +323,17 @@ static int timodwproc(queue_t *, mblk_t *);
static struct module_info timod_info =
{TIMOD_ID, "timod", 0, INFPSZ, 512, 128};
static struct qinit timodrinit = {
(int (*)())timodrput,
(int (*)())timodrsrv,
timodrput,
timodrsrv,
timodopen,
timodclose,
nulldev,
&timod_info,
NULL
};
static struct qinit timodwinit = {
(int (*)())timodwput,
(int (*)())timodwsrv,
timodwput,
timodwsrv,
timodopen,
timodclose,
nulldev,
Expand Down Expand Up @@ -567,7 +567,7 @@ timodclose(
* and T_UNITDATA_IND) messages. All others are queued to
* be handled by the service procedures.
*/
static void
static int
timodrput(queue_t *q, mblk_t *mp)
{
union T_primitives *pptr;
Expand All @@ -578,7 +578,7 @@ timodrput(queue_t *q, mblk_t *mp)
*/
if (q->q_first != 0 && mp->b_datap->db_type < QPCTL) {
(void) putq(q, mp);
return;
return (0);
}

/*
Expand Down Expand Up @@ -623,6 +623,7 @@ timodrput(queue_t *q, mblk_t *mp)
(void) timodrproc(q, mp);
break;
}
return (0);
}

/*
Expand All @@ -636,7 +637,7 @@ timodrput(queue_t *q, mblk_t *mp)
* from the put procedure.
*/
/*ARGSUSED*/
static void
static int
timodrsrv(queue_t *q)
{
mblk_t *mp;
Expand All @@ -646,17 +647,18 @@ timodrsrv(queue_t *q)

tp = (struct tim_tim *)q->q_ptr;
if (!tp)
return;
return (0);

while ((mp = getq(q)) != NULL) {
if (timodrproc(q, mp)) {
/*
* timodrproc did a putbq - stop processing
* messages.
*/
return;
return (0);
}
}
return (0);
}

/*
Expand Down Expand Up @@ -1446,7 +1448,7 @@ timodrproc(queue_t *q, mblk_t *mp)
* be handled by the service procedures.
*/

static void
static int
timodwput(queue_t *q, mblk_t *mp)
{
union T_primitives *pptr;
Expand All @@ -1465,7 +1467,7 @@ timodwput(queue_t *q, mblk_t *mp)
switch (iocbp->ioc_cmd) {
default:
(void) putq(q, mp);
return;
return (0);

case TI_GETINFO:
case TI_SYNC:
Expand All @@ -1474,7 +1476,7 @@ timodwput(queue_t *q, mblk_t *mp)
}
} else {
(void) putq(q, mp);
return;
return (0);
}
}
/*
Expand Down Expand Up @@ -1541,6 +1543,7 @@ timodwput(queue_t *q, mblk_t *mp)
(void) timodwproc(q, mp);
break;
}
return (0);
}
/*
* timodwsrv - Module write queue service procedure.
Expand All @@ -1552,24 +1555,25 @@ timodwput(queue_t *q, mblk_t *mp)
* memory allocation could fail, and there is no reasonable
* recovery mechanism from the put procedure.
*/
static void
static int
timodwsrv(queue_t *q)
{
mblk_t *mp;

ASSERT(q != NULL);
if (q->q_ptr == NULL)
return;
return (0);

while ((mp = getq(q)) != NULL) {
if (timodwproc(q, mp)) {
/*
* timodwproc did a putbq - stop processing
* messages.
*/
return;
return (0);
}
}
return (0);
}

/*
Expand Down

0 comments on commit 6caf82f

Please sign in to comment.