diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-03-25 11:47:32 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-03-25 11:47:32 +0000 |
commit | 5ffb784f5a3c76e1a0dfe2349748d3a9a8f33082 (patch) | |
tree | fa11b97661ae029b4ddbc8c623819e83b24ec211 | |
parent | 676e5a3191976b70611699f226b8447ef2b0ee1a (diff) | |
parent | 61233e713d6c3509d5c076a791c0c2c09cf5cb76 (diff) | |
download | illumos-joyent-5ffb784f5a3c76e1a0dfe2349748d3a9a8f33082.tar.gz |
[illumos-gate merge]
commit 61233e713d6c3509d5c076a791c0c2c09cf5cb76
10112 cfga_sata.c needs a smatch fix
commit 6efbc8a970529717f3354109b91e2916527c0286
10575 tem: NULL pointer errors
commit 776eb96f94b73b997414a501a97c83ac35469fa4
10574 iwscn: NULL pointer errors
commit 3bb8546d907194e91bea367d863eb10ce3fe6621
10558 usbkbm: cast between incompatible function types
commit 9a03ec49b04c02049a85eeb9407566482f469376
10557 srv.9e and put.9e synopsis is broken
-rw-r--r-- | usr/src/lib/cfgadm_plugins/sata/common/cfga_sata.c | 3 | ||||
-rw-r--r-- | usr/src/man/man9e/put.9e | 12 | ||||
-rw-r--r-- | usr/src/man/man9e/srv.9e | 12 | ||||
-rw-r--r-- | usr/src/uts/common/io/iwscons.c | 4 | ||||
-rw-r--r-- | usr/src/uts/common/io/tem.c | 2 | ||||
-rw-r--r-- | usr/src/uts/common/io/usb/clients/usbkbm/usbkbm.c | 50 |
6 files changed, 37 insertions, 46 deletions
diff --git a/usr/src/lib/cfgadm_plugins/sata/common/cfga_sata.c b/usr/src/lib/cfgadm_plugins/sata/common/cfga_sata.c index ad4dcd6dd3..b30433c2be 100644 --- a/usr/src/lib/cfgadm_plugins/sata/common/cfga_sata.c +++ b/usr/src/lib/cfgadm_plugins/sata/common/cfga_sata.c @@ -23,6 +23,7 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. + * Copyright (c) 2018, Joyent, Inc. */ #include <sys/param.h> @@ -1745,7 +1746,7 @@ cfga_msg(struct cfga_msg *msgp, const char *str) } (void) strcpy(q, str); - (*msgp->message_routine)(msgp->appdata_ptr, q); + (void) (*msgp->message_routine)(msgp->appdata_ptr, q); free(q); } diff --git a/usr/src/man/man9e/put.9e b/usr/src/man/man9e/put.9e index 9d7c47c86f..e91c1a9587 100644 --- a/usr/src/man/man9e/put.9e +++ b/usr/src/man/man9e/put.9e @@ -4,7 +4,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH PUT 9E "Nov 12, 1992" +.TH PUT 9E "Mar 21, 2019" .SH NAME put \- receive messages from the preceding queue .SH SYNOPSIS @@ -18,21 +18,19 @@ put \- receive messages from the preceding queue -\fBint prefix\fR\fBrput\fR(\fBqueue_t *\fR\fIq\fR, \fBmblk_t\fR \fI*mp\fR/* read side */ +\fBint prefix\fR\fBrput\fR(\fBqueue_t *\fR\fIq\fR, \fBmblk_t\fR \fI*mp\fR); /* read side */ .fi .LP .nf -\fBint prefix\fR\fBwput\fR(\fBqueue_t *\fR\fIq\fR, \fBmblk_t\fR \fI*mp\fR/* write side */ +\fBint prefix\fR\fBwput\fR(\fBqueue_t *\fR\fIq\fR, \fBmblk_t\fR \fI*mp\fR); /* write side */ .fi .SH INTERFACE LEVEL -.sp .LP Architecture independent level 1 (DDI/DKI). This entry point is required for \fBSTREAMS. \fR .SH ARGUMENTS -.sp .ne 2 .na \fB\fIq\fR \fR @@ -51,7 +49,6 @@ Pointer to the message block. .RE .SH DESCRIPTION -.sp .LP The primary task of the \fBput()\fR routine is to coordinate the passing of messages from one queue to the next in a stream. The \fBput()\fR routine is @@ -106,15 +103,12 @@ The \fBputq\fR(9F) function can be used as a module's \fBput()\fR routine when no special processing is required and all messages are to be enqueued for the \fBsrv\fR(9E) routine. .SH RETURN VALUES -.sp .LP Ignored. .SH CONTEXT -.sp .LP \fBput()\fR routines do not have user context. .SH SEE ALSO -.sp .LP \fBsrv\fR(9E), \fBputctl\fR(9F), \fBputctl1\fR(9F), \fBputnext\fR(9F), \fBputnextctl\fR(9F), \fBputnextctl1\fR(9F), \fBputq\fR(9F), \fBqreply\fR(9F), diff --git a/usr/src/man/man9e/srv.9e b/usr/src/man/man9e/srv.9e index 1d124bf219..54c0e7ebe7 100644 --- a/usr/src/man/man9e/srv.9e +++ b/usr/src/man/man9e/srv.9e @@ -4,7 +4,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH SRV 9E "Nov 12, 1992" +.TH SRV 9E "Mar 15, 2019" .SH NAME srv \- service queued messages .SH SYNOPSIS @@ -18,21 +18,19 @@ srv \- service queued messages -\fBintprefix\fR\fBrsrv\fR(\fBqueue_t *\fR\fIq\fR/* read side */ +\fBint prefix\fR\fBrsrv\fR(\fBqueue_t *\fR\fIq\fR); /* read side */ .fi .LP .nf -\fBintprefix\fR\fBwsrv\fR(\fBqueue_t *\fR\fIq\fR/* write side */ +\fBint prefix\fR\fBwsrv\fR(\fBqueue_t *\fR\fIq\fR); /* write side */ .fi .SH INTERFACE LEVEL -.sp .LP Architecture independent level 1 (DDI/DKI). This entry point is required for \fBSTREAMS\fR. .SH ARGUMENTS -.sp .ne 2 .na \fB\fIq\fR\fR @@ -42,7 +40,6 @@ Pointer to the \fBqueue\fR(9S) structure. .RE .SH DESCRIPTION -.sp .LP The optional service \fBsrv()\fR routine may be included in a \fBSTREAMS \fRmodule or driver for many possible reasons, including: @@ -149,11 +146,9 @@ If the message cannot be passed, put it back on the queue with \fBputnext()\fR. .RE .SH RETURN VALUES -.sp .LP Ignored. .SH SEE ALSO -.sp .LP \fBput\fR(9E), \fBbcanput\fR(9F), \fBbcanputnext\fR(9F), \fBcanput\fR(9F), \fBcanputnext\fR(9F), \fBgetq\fR(9F), \fBnulldev\fR(9F), \fBputbq\fR(9F), @@ -165,7 +160,6 @@ Ignored. .LP \fISTREAMS Programming Guide\fR .SH WARNINGS -.sp .LP Each stream module must specify a read and a write service \fBsrv()\fR routine. If a service routine is not needed (because the \fBput()\fR routine processes diff --git a/usr/src/uts/common/io/iwscons.c b/usr/src/uts/common/io/iwscons.c index 615cd61cd2..aeb6660a2a 100644 --- a/usr/src/uts/common/io/iwscons.c +++ b/usr/src/uts/common/io/iwscons.c @@ -607,7 +607,7 @@ iwscnattach(dev_info_t *devi, ddi_attach_cmd_t cmd) ASSERT(iwscn_dip == NULL); if (ddi_create_minor_node(devi, "iwscn", S_IFCHR, - 0, DDI_PSEUDO, NULL) == DDI_FAILURE) { + 0, DDI_PSEUDO, 0) == DDI_FAILURE) { return (DDI_FAILURE); } @@ -655,7 +655,7 @@ struct cb_ops iwscn_cb_ops = { iwscnioctl, /* ioctl */ nodev, /* devmap */ nodev, /* mmap */ - nodev, /* segmap */ + nodev, /* segmap */ iwscnpoll, /* poll */ ddi_prop_op, /* cb_prop_op */ NULL, /* streamtab */ diff --git a/usr/src/uts/common/io/tem.c b/usr/src/uts/common/io/tem.c index eeda8f375f..b00908c683 100644 --- a/usr/src/uts/common/io/tem.c +++ b/usr/src/uts/common/io/tem.c @@ -376,7 +376,7 @@ tems_failed(cred_t *credp, boolean_t finish_ioctl) (void) ldi_ioctl(tems.ts_hdl, VIS_DEVFINI, 0, FWRITE|FKIOCTL, credp, &lyr_rval); - (void) ldi_close(tems.ts_hdl, NULL, credp); + (void) ldi_close(tems.ts_hdl, 0, credp); tems.ts_hdl = NULL; return (ENXIO); } diff --git a/usr/src/uts/common/io/usb/clients/usbkbm/usbkbm.c b/usr/src/uts/common/io/usb/clients/usbkbm/usbkbm.c index 1fa790d4e9..0242c3782a 100644 --- a/usr/src/uts/common/io/usb/clients/usbkbm/usbkbm.c +++ b/usr/src/uts/common/io/usb/clients/usbkbm/usbkbm.c @@ -83,8 +83,8 @@ static int usbkbm_get_vid_pid(usbkbm_state_t *); /* stream qinit functions defined here */ static int usbkbm_open(queue_t *, dev_t *, int, int, cred_t *); static int usbkbm_close(queue_t *, int, cred_t *); -static void usbkbm_wput(queue_t *, mblk_t *); -static void usbkbm_rput(queue_t *, mblk_t *); +static int usbkbm_wput(queue_t *, mblk_t *); +static int usbkbm_rput(queue_t *, mblk_t *); static ushort_t usbkbm_get_state(usbkbm_state_t *); static void usbkbm_get_scancode(usbkbm_state_t *, int *, enum keystate *); @@ -345,21 +345,21 @@ static struct module_info usbkbm_minfo = { /* read side for key data and ioctl replies */ static struct qinit usbkbm_rinit = { - (int (*)())usbkbm_rput, - (int (*)())NULL, /* service not used */ + usbkbm_rput, + NULL, /* service not used */ usbkbm_open, usbkbm_close, - (int (*)())NULL, + NULL, &usbkbm_minfo }; /* write side for ioctls */ static struct qinit usbkbm_winit = { - (int (*)())usbkbm_wput, - (int (*)())NULL, + usbkbm_wput, + NULL, usbkbm_open, usbkbm_close, - (int (*)())NULL, + NULL, &usbkbm_minfo }; @@ -620,7 +620,7 @@ usbkbm_close(register queue_t *q, int flag, cred_t *crp) * usb keyboard module output queue put procedure: handles M_IOCTL * messages. */ -static void +static int usbkbm_wput(register queue_t *q, register mblk_t *mp) { usbkbm_state_t *usbkbmd; @@ -639,7 +639,7 @@ usbkbm_wput(register queue_t *q, register mblk_t *mp) USB_DPRINTF_L3(PRINT_MASK_ALL, usbkbm_log_handle, "usbkbm_wput exiting:2"); - return; + return (0); } /* kbtrans didn't handle the message. Try to handle it here */ @@ -665,7 +665,7 @@ usbkbm_wput(register queue_t *q, register mblk_t *mp) USB_DPRINTF_L3(PRINT_MASK_ALL, usbkbm_log_handle, "usbkbm_wput exiting:1"); - return; + return (0); } default: break; @@ -679,6 +679,7 @@ usbkbm_wput(register queue_t *q, register mblk_t *mp) USB_DPRINTF_L3(PRINT_MASK_ALL, usbkbm_log_handle, "usbkbm_wput exiting:3"); + return (0); } /* @@ -946,7 +947,7 @@ allocfailure: */ static int usbkbm_kioccmd(usbkbm_state_t *usbkbmd, register mblk_t *mp, - char command, size_t *ioctlrepsize) + char command, size_t *ioctlrepsize) { register mblk_t *datap; register struct iocblk *iocp; @@ -1026,7 +1027,7 @@ usbkbm_kioccmd(usbkbm_state_t *usbkbmd, register mblk_t *mp, * usbkbm_rput : * Put procedure for input from driver end of stream (read queue). */ -static void +static int usbkbm_rput(register queue_t *q, register mblk_t *mp) { usbkbm_state_t *usbkbmd; @@ -1039,7 +1040,7 @@ usbkbm_rput(register queue_t *q, register mblk_t *mp) if (usbkbmd == 0) { freemsg(mp); /* nobody's listening */ - return; + return (0); } switch (mp->b_datap->db_type) { @@ -1052,7 +1053,7 @@ usbkbm_rput(register queue_t *q, register mblk_t *mp) freemsg(mp); - return; + return (0); case M_BREAK: /* * Will get M_BREAK only if this is not the system @@ -1061,19 +1062,19 @@ usbkbm_rput(register queue_t *q, register mblk_t *mp) */ freemsg(mp); - return; + return (0); case M_DATA: if (!(usbkbmd->usbkbm_flags & USBKBM_OPEN)) { freemsg(mp); /* not ready to listen */ - return; + return (0); } break; case M_CTL: usbkbm_mctl_receive(q, mp); - return; + return (0); case M_ERROR: usbkbmd->usbkbm_flags &= ~USBKBM_QWAIT; if (*mp->b_rptr == ENODEV) { @@ -1082,16 +1083,16 @@ usbkbm_rput(register queue_t *q, register mblk_t *mp) freemsg(mp); } - return; + return (0); case M_IOCACK: case M_IOCNAK: putnext(q, mp); - return; + return (0); default: putnext(q, mp); - return; + return (0); } /* @@ -1106,7 +1107,7 @@ usbkbm_rput(register queue_t *q, register mblk_t *mp) usbkbmd->usbkbm_report_format.keyid) { freemsg(mp); - return; + return (0); } else { /* We skip the report id prefix */ mp->b_rptr++; @@ -1117,6 +1118,7 @@ usbkbm_rput(register queue_t *q, register mblk_t *mp) } freemsg(mp); + return (0); } /* @@ -1346,7 +1348,7 @@ usbkbm_streams_setled(struct kbtrans_hardware *kbtrans_hw, int state) */ static boolean_t usbkbm_polled_keycheck(struct kbtrans_hardware *hw, - int *key, enum keystate *state) + int *key, enum keystate *state) { usbkbm_state_t *usbkbmd; uchar_t *buffer; @@ -1674,7 +1676,7 @@ usbkbm_polled_exit(cons_polledio_arg_t arg) */ static void usbkbm_unpack_usb_packet(usbkbm_state_t *usbkbmd, process_key_callback_t func, - uchar_t *usbpacket) + uchar_t *usbpacket) { uchar_t mkb; uchar_t lastmkb; |