Actions
Bug #10706
closedgen_drv: NULL pointer errors
Start date:
2019-04-10
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
Description
Likely one of the root sources of the confusion about ddi_create_minor_node() error cases:
In file included from ../../common/sys/param.h:48:0, from ../../common/io/gen_drv.c:32: ../../common/io/gen_drv.c: In function 'gen_create_display': ../../common/sys/null.h:32:14: error: passing argument 6 of 'ddi_create_minor_node' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/gen_drv.c:1390:47: note: in expansion of macro 'NULL' INST_TO_MINOR(instance), DDI_NT_DISPLAY, NULL)); ^~~~ In file included from ../../common/io/gen_drv.c:43:0: ../../common/sys/sunddi.h:1564:1: note: expected 'int' but argument is of type 'void *' ddi_create_minor_node(dev_info_t *dip, char *name, int spec_type, ^~~~~~~~~~~~~~~~~~~~~ In file included from ../../common/sys/param.h:48:0, from ../../common/io/gen_drv.c:32: ../../common/io/gen_drv.c: In function 'gen_create_mn_disk_chan': ../../common/sys/null.h:32:14: error: passing argument 6 of 'ddi_create_minor_node' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/gen_drv.c:1405:26: note: in expansion of macro 'NULL' DDI_NT_BLOCK_CHAN, NULL) != DDI_SUCCESS) { ^~~~ In file included from ../../common/io/gen_drv.c:43:0: ../../common/sys/sunddi.h:1564:1: note: expected 'int' but argument is of type 'void *' ddi_create_minor_node(dev_info_t *dip, char *name, int spec_type, ^~~~~~~~~~~~~~~~~~~~~ In file included from ../../common/sys/param.h:48:0, from ../../common/io/gen_drv.c:32: ../../common/io/gen_drv.c: In function 'gen_create_mn_disk_wwn': ../../common/sys/null.h:32:14: error: passing argument 6 of 'ddi_create_minor_node' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/gen_drv.c:1462:25: note: in expansion of macro 'NULL' DDI_NT_BLOCK_WWN, NULL) != DDI_SUCCESS) { ^~~~ In file included from ../../common/io/gen_drv.c:43:0: ../../common/sys/sunddi.h:1564:1: note: expected 'int' but argument is of type 'void *' ddi_create_minor_node(dev_info_t *dip, char *name, int spec_type, ^~~~~~~~~~~~~~~~~~~~~ In file included from ../../common/sys/param.h:48:0, from ../../common/io/gen_drv.c:32: ../../common/io/gen_drv.c: In function 'gen_create_mn_disk_cdrom': ../../common/sys/null.h:32:14: error: passing argument 6 of 'ddi_create_minor_node' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/gen_drv.c:1479:23: note: in expansion of macro 'NULL' DDI_NT_CD_CHAN, NULL) != DDI_SUCCESS) { ^~~~ In file included from ../../common/io/gen_drv.c:43:0: ../../common/sys/sunddi.h:1564:1: note: expected 'int' but argument is of type 'void *' ddi_create_minor_node(dev_info_t *dip, char *name, int spec_type, ^~~~~~~~~~~~~~~~~~~~~ In file included from ../../common/sys/param.h:48:0, from ../../common/io/gen_drv.c:32: ../../common/io/gen_drv.c: In function 'gen_create_mn_disk_fd': ../../common/sys/null.h:32:14: error: passing argument 6 of 'ddi_create_minor_node' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/gen_drv.c:1496:26: note: in expansion of macro 'NULL' DDI_NT_BLOCK_CHAN, NULL) != DDI_SUCCESS) { ^~~~ In file included from ../../common/io/gen_drv.c:43:0: ../../common/sys/sunddi.h:1564:1: note: expected 'int' but argument is of type 'void *' ddi_create_minor_node(dev_info_t *dip, char *name, int spec_type, ^~~~~~~~~~~~~~~~~~~~~ In file included from ../../common/sys/param.h:48:0, from ../../common/io/gen_drv.c:32: ../../common/io/gen_drv.c: In function 'gen_create_serial': ../../common/sys/null.h:32:14: error: passing argument 6 of 'ddi_create_minor_node' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/gen_drv.c:1513:24: note: in expansion of macro 'NULL' dmdp->node_type, NULL) != DDI_SUCCESS) { ^~~~ In file included from ../../common/io/gen_drv.c:43:0: ../../common/sys/sunddi.h:1564:1: note: expected 'int' but argument is of type 'void *' ddi_create_minor_node(dev_info_t *dip, char *name, int spec_type, ^~~~~~~~~~~~~~~~~~~~~ In file included from ../../common/sys/param.h:48:0, from ../../common/io/gen_drv.c:32: ../../common/io/gen_drv.c: In function 'gen_create_minor_nodes': ../../common/sys/null.h:32:14: error: passing argument 6 of 'ddi_create_minor_node' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/gen_drv.c:1584:54: note: in expansion of macro 'NULL' (INST_TO_MINOR(instance)), dstatep->node_type, NULL) != ^~~~ In file included from ../../common/io/gen_drv.c:43:0: ../../common/sys/sunddi.h:1564:1: note: expected 'int' but argument is of type 'void *' ddi_create_minor_node(dev_info_t *dip, char *name, int spec_type, ^~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors
Actions