Project

General

Profile

Actions

Bug #10706

closed

gen_drv: NULL pointer errors

Added by Toomas Soome about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
driver - device drivers
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 #1

Updated by Electric Monk about 3 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 7c97b9a788d140cb2ba900ea9e8bcf462a86b109

commit  7c97b9a788d140cb2ba900ea9e8bcf462a86b109
Author: Toomas Soome <tsoome@me.com>
Date:   2019-04-18T05:18:04.000Z

    10706 gen_drv: NULL pointer errors
    Reviewed by: John Levon <john.levon@joyent.com>
    Reviewed by: Gergő Doma <domag02@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF