Skip to content

Commit

Permalink
12622 grover: smatch and NULL pointer errors
Browse files Browse the repository at this point in the history
Reviewed by: Gergő Doma <domag02@gmail.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Patrick Mooney <pmooney@pfmooney.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
  • Loading branch information
tsoome committed May 10, 2020
1 parent 5f94959 commit 12042ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
4 changes: 2 additions & 2 deletions usr/src/uts/sun4u/grover/io/grfans.c
Expand Up @@ -215,7 +215,7 @@ grfans_do_attach(dev_info_t *dip)

if (ddi_create_minor_node(dip, "cpu_fan", S_IFCHR,
DEVINST_TO_MINOR(instance) | CHANNEL_TO_MINOR(CPU_FAN_CHANNEL),
FANS_NODE_TYPE, NULL) == DDI_FAILURE) {
FANS_NODE_TYPE, 0) == DDI_FAILURE) {
cmn_err(CE_WARN, "%s ddi_create_minor_node failed"
" for cpu fan", name);
ddi_regs_map_free(&unitp->cpufan_rhandle);
Expand All @@ -228,7 +228,7 @@ grfans_do_attach(dev_info_t *dip)

if (ddi_create_minor_node(dip, "sys_fan", S_IFCHR,
DEVINST_TO_MINOR(instance) | CHANNEL_TO_MINOR(SYSTEM_FAN_CHANNEL),
FANS_NODE_TYPE, NULL) == DDI_FAILURE) {
FANS_NODE_TYPE, 0) == DDI_FAILURE) {
cmn_err(CE_WARN, "%s ddi_create_minor_node failed"
" for system fan", name);
ddi_regs_map_free(&unitp->cpufan_rhandle);
Expand Down
8 changes: 2 additions & 6 deletions usr/src/uts/sun4u/grover/os/grover.c
Expand Up @@ -24,8 +24,6 @@
* Use is subject to license terms.
*/

#pragma ident "%Z%%M% %I% %E% SMI"

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sunddi.h>
Expand Down Expand Up @@ -57,12 +55,12 @@ set_platform_defaults(void)
* of Southbridge.
*/
#define GROVER_ISA_PATHNAME "/pci@1f,0/isa@7"
ddi_acc_handle_t grover_isa_handle; /* handle for isa pci space */
ddi_acc_handle_t grover_isa_handle; /* handle for isa pci space */

void
load_platform_drivers(void)
{
dev_info_t *dip; /* dip of the isa driver */
dev_info_t *dip; /* dip of the isa driver */


if (i_ddi_attach_hw_nodes("power") != DDI_SUCCESS)
Expand All @@ -88,12 +86,10 @@ load_platform_drivers(void)
dip = e_ddi_hold_devi_by_path(GROVER_ISA_PATHNAME, 0);
if (dip == NULL) {
cmn_err(CE_PANIC, "Could not install the isa driver\n");
return;
}

if (pci_config_setup(dip, &grover_isa_handle) != DDI_SUCCESS) {
cmn_err(CE_PANIC, "Could not get the config space of isa\n");
return;
}
}

Expand Down
10 changes: 0 additions & 10 deletions usr/src/uts/sun4u/grover/platmod/Makefile
Expand Up @@ -40,7 +40,6 @@ UTSBASE = ../../..
#
MODULE = platmod
OBJECTS = $(GROVER_OBJS:%=$(OBJS_DIR)/%)
LINTS = $(GROVER_OBJS:%.o=$(LINTS_DIR)/%.ln)
ROOTMODULE = $(ROOT_GROVER_MISC_DIR)/$(MODULE)

PLAT_DIR = .
Expand All @@ -60,7 +59,6 @@ CLEANFILES += $(PLATLIB) $(SYM_MOD)
# Define targets
#
ALL_TARGET = $(SYM_MOD)
LINT_TARGET = $(MODULE).lint
INSTALL_TARGET = $(BINARY) $(ROOTMODULE)

#
Expand All @@ -81,18 +79,10 @@ clean: $(CLEAN_DEPS)

clobber: $(CLOBBER_DEPS)

lint: $(LINT_DEPS)

modlintlib: $(MODLINTLIB_DEPS)

clean.lint: $(CLEAN_LINT_DEPS)

install: $(INSTALL_DEPS)

check:

LINT_LIB_DIR = $(GROVER_LINT_LIB_DIR)

$(PLATLIB): $(OBJECTS)
$(BUILD.SO) $(OBJECTS)

Expand Down

0 comments on commit 12042ab

Please sign in to comment.