diff options
author | John Levon <john.levon@joyent.com> | 2020-05-26 13:57:13 +0000 |
---|---|---|
committer | John Levon <john.levon@joyent.com> | 2020-05-26 13:57:13 +0000 |
commit | 5b2acc0949194447bba6e45a0fa44d0b5f42f208 (patch) | |
tree | 7ea9eb87bc68fee386dd39035ce715e87a0e673c /usr/src/uts/sun4u/io | |
parent | 8ca018083101bf1cb175869679bc123187fb1bab (diff) | |
parent | 2a1277d3064386cd5c4e372301007aa330bf1d5e (diff) | |
download | illumos-joyent-gcc9.tar.gz |
mergegcc9
Diffstat (limited to 'usr/src/uts/sun4u/io')
-rw-r--r-- | usr/src/uts/sun4u/io/gpio_87317.c | 14 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/i2c/clients/adm1026.c | 6 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/i2c/clients/pic16f819.c | 14 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/i2c/clients/ssc050.c | 20 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/i2c/clients/ssc100.c | 6 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/pci/db21554.c | 108 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/pic16f747.c | 4 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/rmc_comm_drvintf.c | 14 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/rmcadm.c | 2 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/rmclomv.c | 14 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/sbbc.c | 36 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/todds1287.c | 6 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/todds1337.c | 14 |
13 files changed, 130 insertions, 128 deletions
diff --git a/usr/src/uts/sun4u/io/gpio_87317.c b/usr/src/uts/sun4u/io/gpio_87317.c index 450425e407..3c218b58b5 100644 --- a/usr/src/uts/sun4u/io/gpio_87317.c +++ b/usr/src/uts/sun4u/io/gpio_87317.c @@ -213,7 +213,7 @@ gpio_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) instance = ddi_get_instance(dip); DBG(dip, "attach: instance is %d", instance, 0, 0, 0, 0); if (ddi_soft_state_zalloc(statep, instance) != DDI_SUCCESS) - goto attach_failed; + goto attach_failed; softc = getsoftc(instance); softc->gp_dip = dip; softc->gp_state = 0; @@ -226,7 +226,7 @@ gpio_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) dev_attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC; if (ddi_regs_map_setup(dip, 0, (caddr_t *)&softc->gp_regs, 0, 0, &dev_attr, &softc->gp_handle) != DDI_SUCCESS) - goto attach_failed; + goto attach_failed; DBG(dip, "attach: regs=0x%p", (uintptr_t)softc->gp_regs, 0, 0, 0, 0); DBG(dip, "attach: port 1 data is %x", @@ -254,10 +254,10 @@ gpio_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) (uintptr_t)ddi_get8(softc->gp_handle, &softc->gp_regs[7]), 0, 0, 0, 0); - /* Create device minor nodes. */ + /* Create device minor nodes. */ if (ddi_create_minor_node(dip, "gpio", S_IFCHR, - instance, NULL, NULL) == DDI_FAILURE) { + instance, NULL, 0) == DDI_FAILURE) { ddi_regs_map_free(&softc->gp_handle); goto attach_failed; } @@ -267,7 +267,7 @@ gpio_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) case DDI_RESUME: - /* Nothing to do for a resume. */ + /* Nothing to do for a resume. */ return (DDI_SUCCESS); @@ -340,7 +340,7 @@ gpio_close(dev_t dev, int flag, int otyp, cred_t *credp) /* ARGSUSED */ static int gpio_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { int instance = getminor(dev); struct gpio_softc *softc = getsoftc(instance); @@ -423,7 +423,7 @@ gpio_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, #ifdef DEBUG void gpio_debug(dev_info_t *dip, char *format, uint_t arg1, uint_t arg2, uint_t arg3, - uint_t arg4, uint_t arg5) + uint_t arg4, uint_t arg5) { if (gpio_debug_flag == 0) { return; diff --git a/usr/src/uts/sun4u/io/i2c/clients/adm1026.c b/usr/src/uts/sun4u/io/i2c/clients/adm1026.c index 7ab697104c..4e8340d642 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/adm1026.c +++ b/usr/src/uts/sun4u/io/i2c/clients/adm1026.c @@ -312,7 +312,7 @@ adm1026_do_attach(dev_info_t *dip) D2CMN_ERR((CE_WARN, "adm1026_do_attach: ddi_create_minor_node")); if (ddi_create_minor_node(dip, "adm1026", S_IFCHR, instance, - "ddi_i2c:led_control", NULL) == DDI_FAILURE) { + "ddi_i2c:led_control", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "adm1026_do_attach: ddi_create_minor_node failed"); ddi_soft_state_free(adm1026soft_statep, instance); @@ -438,7 +438,7 @@ adm1026_put8(adm1026_unit_t *unitp, uint8_t reg, uint8_t val) */ static int adm1026_send8(adm1026_unit_t *unitp, uint8_t reg, uint8_t reg_val, - uint8_t reg_mask) + uint8_t reg_mask) { uint8_t val = 0; int err; @@ -593,7 +593,7 @@ adm1026_get_config(adm1026_unit_t *unitp, int cmd, uint32_t mask, uint32_t *val) static int adm1026_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) diff --git a/usr/src/uts/sun4u/io/i2c/clients/pic16f819.c b/usr/src/uts/sun4u/io/i2c/clients/pic16f819.c index 0f093c72d5..71cfcde9b3 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/pic16f819.c +++ b/usr/src/uts/sun4u/io/i2c/clients/pic16f819.c @@ -275,17 +275,17 @@ pic16f819_close(dev_t dev, int flags, int otyp, cred_t *credp) static int pic16f819_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) + cred_t *credp, int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) - struct pic16f819_unit *unitp; - int instance; - int err = 0; + struct pic16f819_unit *unitp; + int instance; + int err = 0; i2c_reg_t ioctl_reg; - uchar_t val8; + uchar_t val8; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "PIC16F819: ioctl: arg passed in to ioctl " "= NULL\n")); err = EINVAL; @@ -389,7 +389,7 @@ pic16f819_do_attach(dev_info_t *dip) "%s%d", ddi_node_name(dip), instance); if (ddi_create_minor_node(dip, "fan_1", S_IFCHR, instance, - "ddi_i2c:pic", NULL) == DDI_FAILURE) { + "ddi_i2c:pic", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s ddi_create_minor_node failed for " "%s\n", unitp->pic16f819_name, "pic16f819"); ddi_soft_state_free(pic16f819soft_statep, instance); diff --git a/usr/src/uts/sun4u/io/i2c/clients/ssc050.c b/usr/src/uts/sun4u/io/i2c/clients/ssc050.c index 1cf46a0574..1a79a14f4f 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/ssc050.c +++ b/usr/src/uts/sun4u/io/i2c/clients/ssc050.c @@ -306,7 +306,7 @@ ssc050_set(struct ssc050_unit *unitp, int reg, uchar_t byte) static int ssc050_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) @@ -317,14 +317,14 @@ ssc050_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, i2c_reg_t ioctl_reg; int port = MINOR_TO_PORT(getminor(dev)); int instance = MINOR_TO_INST(getminor(dev)); - uchar_t reg, val8; - uchar_t control; + uchar_t reg, val8; + uchar_t control; uchar_t fan_count; int divisor; int32_t fan_speed; uint8_t inverted_mask; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "SSC050: ioctl: arg passed in to ioctl " "= NULL")); return (EINVAL); @@ -498,10 +498,10 @@ ssc050_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, val8)); err = ssc050_set(unitp, reg, val8 | SSC050_DATADIRECTION_BIT); - if (err != I2C_SUCCESS) { - break; - } - delay(10); + if (err != I2C_SUCCESS) { + break; + } + delay(10); } } @@ -647,7 +647,7 @@ ssc050_do_attach(dev_info_t *dip) PORT_TO_MINOR(I2C_PORT(i)); if (ddi_create_minor_node(dip, name, S_IFCHR, minor_number, - "ddi_i2c:ioexp", NULL) == DDI_FAILURE) { + "ddi_i2c:ioexp", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s: failed to create node for %s", unitp->name, name); ddi_soft_state_free(ssc050soft_statep, instance); @@ -684,7 +684,7 @@ ssc050_do_detach(dev_info_t *dip) int ssc050_get_port_bit(dev_info_t *dip, int port, int bit, uchar_t *rval, - int flags) + int flags) { struct ssc050_unit *unitp; int instance; diff --git a/usr/src/uts/sun4u/io/i2c/clients/ssc100.c b/usr/src/uts/sun4u/io/i2c/clients/ssc100.c index 9ebc3eabc8..0c92f7b977 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/ssc100.c +++ b/usr/src/uts/sun4u/io/i2c/clients/ssc100.c @@ -294,7 +294,7 @@ ssc100_set(struct ssc100_unit *unitp, uchar_t byte) static int ssc100_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) + cred_t *credp, int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) @@ -306,7 +306,7 @@ ssc100_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, i2c_reg_t ioctl_reg; uchar_t byte; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "SSC100: ioctl: arg passed in to ioctl " "= NULL")); err = EINVAL; @@ -529,7 +529,7 @@ ssc100_do_attach(dev_info_t *dip) "%s%d", ddi_node_name(dip), instance); if (ddi_create_minor_node(dip, "ssc100", S_IFCHR, instance, - "ddi_i2c:ioexp", NULL) == DDI_FAILURE) { + "ddi_i2c:ioexp", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s ddi_create_minor_node failed for " "%s", unitp->ssc100_name, "ssc100"); ddi_soft_state_free(ssc100soft_statep, instance); diff --git a/usr/src/uts/sun4u/io/pci/db21554.c b/usr/src/uts/sun4u/io/pci/db21554.c index f51ad8c0e6..fc1e83fd19 100644 --- a/usr/src/uts/sun4u/io/pci/db21554.c +++ b/usr/src/uts/sun4u/io/pci/db21554.c @@ -321,7 +321,7 @@ static void db_pci_get_conf_regs(ddi_acc_handle_t config_handle, #ifdef DEBUG static void db_debug(uint64_t func_id, dev_info_t *dip, char *fmt, - uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5); + uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5); #endif static int db_prop_op(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op, @@ -348,34 +348,34 @@ static struct cb_ops db_cb_ops = { nodev /* int (*cb_awrite)() */ }; -static uint8_t db_ddi_get8(ddi_acc_impl_t *handle, uint8_t *addr); +static uint8_t db_ddi_get8(ddi_acc_impl_t *handle, uint8_t *addr); static uint16_t db_ddi_get16(ddi_acc_impl_t *handle, uint16_t *addr); static uint32_t db_ddi_get32(ddi_acc_impl_t *handle, uint32_t *addr); static uint64_t db_ddi_get64(ddi_acc_impl_t *handle, uint64_t *addr); -static void db_ddi_put8(ddi_acc_impl_t *handle, uint8_t *addr, - uint8_t data); -static void db_ddi_put16(ddi_acc_impl_t *handle, uint16_t *addr, - uint16_t data); -static void db_ddi_put32(ddi_acc_impl_t *handle, uint32_t *addr, - uint32_t data); -static void db_ddi_put64(ddi_acc_impl_t *handle, uint64_t *addr, - uint64_t data); -static void db_ddi_rep_get8(ddi_acc_impl_t *handle, uint8_t *host_addr, - uint8_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_get16(ddi_acc_impl_t *handle, uint16_t *host_addr, - uint16_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_get32(ddi_acc_impl_t *handle, uint32_t *host_addr, - uint32_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_get64(ddi_acc_impl_t *handle, uint64_t *host_addr, - uint64_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_put8(ddi_acc_impl_t *handle, uint8_t *host_addr, - uint8_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_put16(ddi_acc_impl_t *handle, uint16_t *host_addr, - uint16_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_put32(ddi_acc_impl_t *handle, uint32_t *host_addr, - uint32_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_put64(ddi_acc_impl_t *handle, uint64_t *host_addr, - uint64_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_put8(ddi_acc_impl_t *handle, uint8_t *addr, + uint8_t data); +static void db_ddi_put16(ddi_acc_impl_t *handle, uint16_t *addr, + uint16_t data); +static void db_ddi_put32(ddi_acc_impl_t *handle, uint32_t *addr, + uint32_t data); +static void db_ddi_put64(ddi_acc_impl_t *handle, uint64_t *addr, + uint64_t data); +static void db_ddi_rep_get8(ddi_acc_impl_t *handle, uint8_t *host_addr, + uint8_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_get16(ddi_acc_impl_t *handle, uint16_t *host_addr, + uint16_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_get32(ddi_acc_impl_t *handle, uint32_t *host_addr, + uint32_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_get64(ddi_acc_impl_t *handle, uint64_t *host_addr, + uint64_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_put8(ddi_acc_impl_t *handle, uint8_t *host_addr, + uint8_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_put16(ddi_acc_impl_t *handle, uint16_t *host_addr, + uint16_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_put32(ddi_acc_impl_t *handle, uint32_t *host_addr, + uint32_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_put64(ddi_acc_impl_t *handle, uint64_t *host_addr, + uint64_t *dev_addr, size_t repcount, uint_t flags); static struct dev_ops db_dev_ops = { DEVO_REV, /* devo_rev */ @@ -410,16 +410,16 @@ static struct modlinkage modlinkage = { }; /* soft state pointer and structure template. */ -static void *db_state; +static void *db_state; /* * forward function declarations: */ static void db_uninitchild(dev_info_t *); -static int db_initchild(dev_info_t *child); -static int db_create_pci_prop(dev_info_t *child); -static int db_save_config_regs(db_ctrl_t *dbp); -static int db_restore_config_regs(db_ctrl_t *dbp); +static int db_initchild(dev_info_t *child); +static int db_create_pci_prop(dev_info_t *child); +static int db_save_config_regs(db_ctrl_t *dbp); +static int db_restore_config_regs(db_ctrl_t *dbp); /* * FMA error callback @@ -675,7 +675,7 @@ db_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) if (ddi_create_minor_node(dip, name, S_IFCHR, PCIHP_AP_MINOR_NUM(instance, PCIHP_DEBUG_MINOR), - NULL, NULL) == DDI_FAILURE) { + NULL, 0) == DDI_FAILURE) { cmn_err(CE_NOTE, "%s#%d: node creation failure", ddi_driver_name(dbp->dip), instance); } @@ -1443,7 +1443,7 @@ db_close(dev_t dev, int flag, int otyp, cred_t *cred_p) /*ARGSUSED*/ static int db_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred_p, - int *rval_p) + int *rval_p) { int rc = DDI_SUCCESS; #ifdef DB_DEBUG @@ -1698,15 +1698,15 @@ db_pci_get_conf_regs(ddi_acc_handle_t config_handle, db_conf_regs_t *cr) /* * Function: db_pci_map * - * Note: Only memory accesses are direct. IO could be direct - * or indirect. Config accesses are always indirect. - * The question here is, does the "assigned-addresses" - * property entry represents the addresses in the - * local domain or the host domain itself. - * Strictly speaking, the assumption should be that - * it is in the local domain, as the transactions - * upstream or downstream are automatically - * translated by the bridge chip anyway. + * Note: Only memory accesses are direct. IO could be direct + * or indirect. Config accesses are always indirect. + * The question here is, does the "assigned-addresses" + * property entry represents the addresses in the + * local domain or the host domain itself. + * Strictly speaking, the assumption should be that + * it is in the local domain, as the transactions + * upstream or downstream are automatically + * translated by the bridge chip anyway. * * Return values: * DDI_SUCCESS: map call by child device success @@ -1715,7 +1715,7 @@ db_pci_get_conf_regs(ddi_acc_handle_t config_handle, db_conf_regs_t *cr) static int db_pci_map(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp, - off_t offset, off_t len, caddr_t *addrp) + off_t offset, off_t len, caddr_t *addrp) { register dev_info_t *pdip; int reg_proplen, num_regs, rnumber; @@ -2088,7 +2088,7 @@ char *db_ctlop_name[] = { static int db_ctlops(dev_info_t *dip, dev_info_t *rdip, - ddi_ctl_enum_t ctlop, void *arg, void *result) + ddi_ctl_enum_t ctlop, void *arg, void *result) { if ((ctlop >= DDI_CTLOPS_DMAPMAPC) && @@ -2865,7 +2865,7 @@ db_ddi_put64(ddi_acc_impl_t *handle, uint64_t *addr, uint64_t data) */ static void db_ddi_rep_get8(ddi_acc_impl_t *handle, uint8_t *host_addr, - uint8_t *dev_addr, size_t repcount, uint_t flags) + uint8_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2881,7 +2881,7 @@ db_ddi_rep_get8(ddi_acc_impl_t *handle, uint8_t *host_addr, */ static void db_ddi_rep_get16(ddi_acc_impl_t *handle, uint16_t *host_addr, - uint16_t *dev_addr, size_t repcount, uint_t flags) + uint16_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2897,7 +2897,7 @@ db_ddi_rep_get16(ddi_acc_impl_t *handle, uint16_t *host_addr, */ static void db_ddi_rep_get32(ddi_acc_impl_t *handle, uint32_t *host_addr, - uint32_t *dev_addr, size_t repcount, uint_t flags) + uint32_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2913,7 +2913,7 @@ db_ddi_rep_get32(ddi_acc_impl_t *handle, uint32_t *host_addr, */ static void db_ddi_rep_get64(ddi_acc_impl_t *handle, uint64_t *host_addr, - uint64_t *dev_addr, size_t repcount, uint_t flags) + uint64_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2929,7 +2929,7 @@ db_ddi_rep_get64(ddi_acc_impl_t *handle, uint64_t *host_addr, */ static void db_ddi_rep_put8(ddi_acc_impl_t *handle, uint8_t *host_addr, - uint8_t *dev_addr, size_t repcount, uint_t flags) + uint8_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2945,7 +2945,7 @@ db_ddi_rep_put8(ddi_acc_impl_t *handle, uint8_t *host_addr, */ static void db_ddi_rep_put16(ddi_acc_impl_t *handle, uint16_t *host_addr, - uint16_t *dev_addr, size_t repcount, uint_t flags) + uint16_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2961,7 +2961,7 @@ db_ddi_rep_put16(ddi_acc_impl_t *handle, uint16_t *host_addr, */ static void db_ddi_rep_put32(ddi_acc_impl_t *handle, uint32_t *host_addr, - uint32_t *dev_addr, size_t repcount, uint_t flags) + uint32_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2977,7 +2977,7 @@ db_ddi_rep_put32(ddi_acc_impl_t *handle, uint32_t *host_addr, */ static void db_ddi_rep_put64(ddi_acc_impl_t *handle, uint64_t *host_addr, - uint64_t *dev_addr, size_t repcount, uint_t flags) + uint64_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2991,7 +2991,7 @@ db_ddi_rep_put64(ddi_acc_impl_t *handle, uint64_t *host_addr, static void db_debug(uint64_t func_id, dev_info_t *dip, char *fmt, - uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5) + uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5) { char *s = NULL; uint_t dip_no_disp = 0; @@ -3097,7 +3097,7 @@ db_fm_fini(db_ctrl_t *db_p) /*ARGSUSED*/ static int db_fm_init_child(dev_info_t *dip, dev_info_t *tdip, int cap, - ddi_iblock_cookie_t *ibc) + ddi_iblock_cookie_t *ibc) { db_ctrl_t *db_p = (db_ctrl_t *)ddi_get_soft_state(db_state, ddi_get_instance(dip)); diff --git a/usr/src/uts/sun4u/io/pic16f747.c b/usr/src/uts/sun4u/io/pic16f747.c index 011a8974d0..0a8a4d398c 100644 --- a/usr/src/uts/sun4u/io/pic16f747.c +++ b/usr/src/uts/sun4u/io/pic16f747.c @@ -220,7 +220,7 @@ pic_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) (void) sprintf(name, "env-monitor%d", inst); minor = PIC_INST_TO_MINOR(inst) | PIC_UNIT_TO_MINOR(0); if (ddi_create_minor_node(dip, name, S_IFCHR, minor, - DDI_PSEUDO, NULL) == DDI_FAILURE) { + DDI_PSEUDO, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "ddi_create_minor_node() failed for inst %d\n", inst); @@ -261,7 +261,7 @@ pic_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) minor_name = pic_nodes[i].minor_name; minor = PIC_INST_TO_MINOR(inst) | PIC_UNIT_TO_MINOR(i); if (ddi_create_minor_node(dip, minor_name, S_IFCHR, - minor, PICDEV_NODE_TYPE, NULL) == DDI_FAILURE) { + minor, PICDEV_NODE_TYPE, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s:%d ddi_create_minor_node failed", ddi_driver_name(dip), inst); diff --git a/usr/src/uts/sun4u/io/rmc_comm_drvintf.c b/usr/src/uts/sun4u/io/rmc_comm_drvintf.c index 6c173379e0..58fd2db8eb 100644 --- a/usr/src/uts/sun4u/io/rmc_comm_drvintf.c +++ b/usr/src/uts/sun4u/io/rmc_comm_drvintf.c @@ -360,13 +360,13 @@ rmc_comm_send_req_resp(struct rmc_comm_state *rcs, rmc_comm_msg_t *request, if (response != NULL) { exp_resp->msg_type = response->msg_type; exp_resp->msg_buf = (uint8_t *)response->msg_buf; - exp_resp->msg_msglen = (uint16_t)response->msg_bytes; - exp_resp->msg_bufsiz = (uint16_t)response->msg_len; + exp_resp->msg_msglen = response->msg_bytes; + exp_resp->msg_bufsiz = response->msg_len; } else { exp_resp->msg_type = DP_NULL_MSG; - exp_resp->msg_buf = (uint8_t)NULL; - exp_resp->msg_bufsiz = (uint16_t)0; - exp_resp->msg_msglen = (uint16_t)0; + exp_resp->msg_buf = NULL; + exp_resp->msg_bufsiz = 0; + exp_resp->msg_msglen = 0; } /* @@ -374,7 +374,7 @@ rmc_comm_send_req_resp(struct rmc_comm_state *rcs, rmc_comm_msg_t *request, */ req.msg_type = request->msg_type; req.msg_buf = (uint8_t *)request->msg_buf; - req.msg_msglen = (uint16_t)request->msg_len; + req.msg_msglen = request->msg_len; /* * send the message and wait for the reply or ACKnowledgment @@ -636,7 +636,7 @@ int rmc_comm_reg_intr(uint8_t msg_type, rmc_comm_intrfunc_t intr_handler, rmc_comm_msg_t *msgbuf, uint_t *state, kmutex_t *lock) { - struct rmc_comm_state *rcs; + struct rmc_comm_state *rcs; dp_msg_intr_t *msgintr; int err = RCNOERR; diff --git a/usr/src/uts/sun4u/io/rmcadm.c b/usr/src/uts/sun4u/io/rmcadm.c index 2ad9a87c23..ed4da3a286 100644 --- a/usr/src/uts/sun4u/io/rmcadm.c +++ b/usr/src/uts/sun4u/io/rmcadm.c @@ -233,7 +233,7 @@ rmcadm_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) return (DDI_FAILURE); err = ddi_create_minor_node(dip, "rmcadm", S_IFCHR, - instance, DDI_PSEUDO, NULL); + instance, DDI_PSEUDO, 0); if (err != DDI_SUCCESS) return (DDI_FAILURE); diff --git a/usr/src/uts/sun4u/io/rmclomv.c b/usr/src/uts/sun4u/io/rmclomv.c index 13c10e3a01..9d00fdd6fb 100644 --- a/usr/src/uts/sun4u/io/rmclomv.c +++ b/usr/src/uts/sun4u/io/rmclomv.c @@ -399,7 +399,7 @@ rmclomv_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) return (DDI_FAILURE); err = ddi_create_minor_node(dip, "rmclomv", S_IFCHR, - instance, DDI_PSEUDO, NULL); + instance, DDI_PSEUDO, 0); if (err != DDI_SUCCESS) return (DDI_FAILURE); @@ -1621,7 +1621,7 @@ refresh_name_cache(int force_fail) if (retval == 0) { retval = rmclomv_do_cmd(DP_GET_SYSINFO, DP_GET_SYSINFO_R, - sizeof (sysinfo), NULL, (intptr_t)&sysinfo); + sizeof (sysinfo), (intptr_t)NULL, (intptr_t)&sysinfo); } if (retval == 0) { fru_cmd.handle = DP_NULL_HANDLE; @@ -2896,7 +2896,7 @@ rmclomv_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred_p, case ENVMONIOCCHASSISSERIALNUM: retval = rmclomv_do_cmd(DP_GET_SDP_VERSION, DP_GET_SDP_VERSION_R, sizeof (rmc_sdpver_r), - NULL, (intptr_t)&rmc_sdpver_r); + (intptr_t)NULL, (intptr_t)&rmc_sdpver_r); if (retval != 0) { cmn_err(CE_WARN, "DP_GET_SDP_VERSION failed, ret=%d\n", @@ -2908,7 +2908,7 @@ rmclomv_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred_p, } retval = rmclomv_do_cmd(DP_GET_CHASSIS_SERIALNUM, DP_GET_CHASSIS_SERIALNUM_R, sizeof (rmc_serialnum_r), - NULL, (intptr_t)&rmc_serialnum_r); + (intptr_t)NULL, (intptr_t)&rmc_serialnum_r); if (retval != 0) { break; @@ -2940,7 +2940,7 @@ rmclomv_checkrmc(caddr_t arg) int err; int retries; int state; - dp_get_sysinfo_r_t sysinfo; + dp_get_sysinfo_r_t sysinfo; CALLB_CPR_INIT(&cprinfo, &rmclomv_checkrmc_lock, callb_generic_cpr, "rmclomv_checkrmc"); @@ -3005,7 +3005,7 @@ rmclomv_checkrmc(caddr_t arg) mutex_exit(&rmclomv_checkrmc_lock); err = rmclomv_do_cmd(DP_GET_SYSINFO, DP_GET_SYSINFO_R, - sizeof (sysinfo), NULL, (intptr_t)&sysinfo); + sizeof (sysinfo), (intptr_t)NULL, (intptr_t)&sysinfo); if (err == 0) { mutex_enter(&rmclomv_state_lock); state = rmclomv_rmc_state; @@ -3393,7 +3393,7 @@ plat_timesync(void *arg) if (arg != NULL) { /* Request the time from the RMC clock. */ retval = rmclomv_do_cmd(DP_GET_DATE_TIME, DP_GET_DATE_TIME_R, - DATE_TIME_MSG_SIZE, NULL, (intptr_t)&buffer); + DATE_TIME_MSG_SIZE, (intptr_t)NULL, (intptr_t)&buffer); /* * If we were able to get the time lets set the local clock. diff --git a/usr/src/uts/sun4u/io/sbbc.c b/usr/src/uts/sun4u/io/sbbc.c index 615ea8549e..10117ae4dd 100644 --- a/usr/src/uts/sun4u/io/sbbc.c +++ b/usr/src/uts/sun4u/io/sbbc.c @@ -172,15 +172,15 @@ static struct bus_ops sbbc_bus_ops = { 0, 0, 0, - NULL, /* (*bus_map_fault)() */ + NULL, /* (*bus_map_fault)() */ ddi_no_dma_map, ddi_no_dma_allochdl, - ddi_no_dma_freehdl, /* (*bus_dma_freehdl)() */ - ddi_no_dma_bindhdl, /* (*bus_dma_bindhdl)() */ - ddi_no_dma_unbindhdl, /* (*bus_dma_unbindhdl)() */ - ddi_no_dma_flush, /* (*bus_dma_flush)() */ - ddi_no_dma_win, /* (*bus_dma_win)() */ - ddi_no_dma_mctl, /* (*bus_dma_ctl)() */ + ddi_no_dma_freehdl, /* (*bus_dma_freehdl)() */ + ddi_no_dma_bindhdl, /* (*bus_dma_bindhdl)() */ + ddi_no_dma_unbindhdl, /* (*bus_dma_unbindhdl)() */ + ddi_no_dma_flush, /* (*bus_dma_flush)() */ + ddi_no_dma_win, /* (*bus_dma_win)() */ + ddi_no_dma_mctl, /* (*bus_dma_ctl)() */ sbbc_ctlops, ddi_bus_prop_op, 0, /* (*bus_get_eventcookie)(); */ @@ -425,7 +425,7 @@ sbbc_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) (void) sprintf(name, "sbbc%d", instance); if (ddi_create_minor_node(dip, name, S_IFCHR, instance, NULL, - NULL) == DDI_FAILURE) { + 0) == DDI_FAILURE) { ddi_remove_minor_node(dip, NULL); goto failed; } @@ -510,7 +510,7 @@ sbbc_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) */ static int sbbc_busmap(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp, - off_t off, off_t len, caddr_t *addrp) + off_t off, off_t len, caddr_t *addrp) { struct sbbcsoft *sbbcsoftp; sbbc_child_regspec_t *child_rp, *child_regs; @@ -690,7 +690,7 @@ sbbc_add_intr_impl(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op, childintr->status = SBBC_INTR_STATE_DISABLE; for (i = 0; i < MAX_SBBC_DEVICES; i++) { - if (sbbcsoftp->child_intr[i] == 0) { + if (sbbcsoftp->child_intr[i] == NULL) { sbbcsoftp->child_intr[i] = childintr; break; } @@ -705,7 +705,8 @@ sbbc_add_intr_impl(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op, cmn_err(CE_WARN, "sbbc%d: failed to add intr for %s", instance, ddi_get_name(rdip)); kmem_free(childintr, sizeof (struct sbbc_child_intr)); - sbbcsoftp->child_intr[i] = NULL; + if (i < MAX_SBBC_DEVICES) + sbbcsoftp->child_intr[i] = NULL; } /* @@ -817,7 +818,7 @@ sbbc_update_intr_state(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op, */ static int sbbc_ctlops(dev_info_t *dip, dev_info_t *rdip, ddi_ctl_enum_t op, - void *arg, void *result) + void *arg, void *result) { sbbc_child_regspec_t *child_rp; int i, n; @@ -1121,7 +1122,7 @@ sbbc_close(dev_t dev, int flag, int otype, cred_t *credp) /*ARGSUSED2*/ static int sbbc_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { struct sbbcsoft *sbbcsoftp; @@ -1144,7 +1145,7 @@ sbbc_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, return (EINVAL); } - if (arg == NULL) { + if (arg == (intptr_t)NULL) { return (ENXIO); } @@ -1184,7 +1185,7 @@ sbbc_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, return (EINVAL); } - if (arg == NULL) { + if (arg == (intptr_t)NULL) { return (ENXIO); } @@ -1372,7 +1373,8 @@ sbbc_intr_wrapper(caddr_t arg) * used to crash the system. */ static int -sbbc_offset_valid(uint32_t offset) { +sbbc_offset_valid(uint32_t offset) +{ /* * Check for proper alignment first. */ @@ -1415,7 +1417,7 @@ sbbc_offset_valid(uint32_t offset) { #ifdef DEBUG void sbbc_dbg(uint32_t flag, dev_info_t *dip, char *fmt, - uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5) + uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5) { char *s = NULL; diff --git a/usr/src/uts/sun4u/io/todds1287.c b/usr/src/uts/sun4u/io/todds1287.c index 35dc7ad8fc..bf9cb8bd42 100644 --- a/usr/src/uts/sun4u/io/todds1287.c +++ b/usr/src/uts/sun4u/io/todds1287.c @@ -176,7 +176,7 @@ static ddi_softintr_t ds1287_softintr_id; static kmutex_t ds1287_reg_mutex; /* Protects ds1287 Registers */ static struct modldrv modldrv = { - &mod_driverops, /* Type of module. This one is a driver */ + &mod_driverops, /* Type of module. This one is a driver */ "ds1287 clock driver", /* Name of the module. */ &ds1287_ops, /* driver ops */ }; @@ -354,7 +354,7 @@ ds1287_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) * creating the minor node. */ if (ddi_create_minor_node(dip, "power_button", S_IFCHR, - (instance << 8) + 0, "ddi_power_button", NULL) == DDI_FAILURE) { + (instance << 8) + 0, "ddi_power_button", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "ds1287_attach: Failed to create minor node"); goto error3; } @@ -453,7 +453,7 @@ ds1287_close(dev_t dev, int flags, int otyp, cred_t *credp) /*ARGSUSED4*/ static int ds1287_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) + cred_t *credp, int *rvalp) { struct ds1287 *softsp; int clone; diff --git a/usr/src/uts/sun4u/io/todds1337.c b/usr/src/uts/sun4u/io/todds1337.c index 319928bde7..4688467769 100644 --- a/usr/src/uts/sun4u/io/todds1337.c +++ b/usr/src/uts/sun4u/io/todds1337.c @@ -67,8 +67,8 @@ static uint_t todds1337_set_watchdog_timer(uint_t); static uint_t todds1337_clear_watchdog_timer(void); static void todds1337_set_power_alarm(timestruc_t); static void todds1337_clear_power_alarm(void); -static int todds1337_setup_prom(); -static void todds1337_rele_prom(); +static int todds1337_setup_prom(void); +static void todds1337_rele_prom(void); static int todds1337_prom_getdate(struct rtc_t *rtc); static int todds1337_prom_setdate(struct rtc_t *rtc); @@ -90,7 +90,7 @@ static ihandle_t todds1337_ihandle = 0; #define I2C_CYCLIC_TIMEOUT 1000000000 uint_t i2c_cyclic_timeout = I2C_CYCLIC_TIMEOUT; static int sync_clock_once = 1; -static struct rtc_t soft_rtc; +static struct rtc_t soft_rtc; /* * cp_ops structure @@ -898,7 +898,7 @@ todds1337_getinfo(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, * execute the get-time method */ static int -todds1337_setup_prom() +todds1337_setup_prom(void) { pnode_t todnode; char tod1337_devpath[MAXNAMELEN]; @@ -920,7 +920,7 @@ todds1337_setup_prom() /* * Now open the node and store it's ihandle */ - if ((todds1337_ihandle = prom_open(tod1337_devpath)) == NULL) { + if ((todds1337_ihandle = prom_open(tod1337_devpath)) == 0) { cmn_err(CE_WARN, "prom_open failed"); return (DDI_FAILURE); } @@ -932,7 +932,7 @@ todds1337_setup_prom() * Closes the prom interface */ static void -todds1337_rele_prom() +todds1337_rele_prom(void) { (void) prom_close(todds1337_ihandle); } @@ -958,7 +958,7 @@ todds1337_prom_getdate(struct rtc_t *rtc) (void) p1275_cif_handler(&ci); promif_postprom(); - year = p1275_cell2int(ci[6]); + year = p1275_cell2int(ci[6]); rtc->rtc_mon = p1275_cell2int(ci[7]); rtc->rtc_dom = p1275_cell2int(ci[8]); rtc->rtc_dow = 0; |