Project

General

Profile

Actions

Feature #12508

closed

ndi_devi_alloc() and friends could take const char * names

Added by Robert Mustacchi about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Today, the ndi_devi_alloc function takes a char * for the name of the node to create. However, the only real user of this is in i_ddi_alloc_node which just passes it directly to i_ddi_strdup. In this case, this can be const and anything that passed a char * will be able to accept a const char *. This will make it easier for newer nexus drivers to just have constant string data, which would have ended up in a read-only section anyways.

To test this, I went and ran a wsdiff of a debug build between two things. The following were the differences, annotated with the reason:

  • DOF:
    • opt/SUNWdtrt/tst/i386/ustack/tst.helper.exe
    • lib/amd64/libc.so.1
    • lib/libc.so.1
    • usr/sbin/isns
    • usr/lib/libc/libc_hwcap3.so.1
    • usr/lib/libc/libc_hwcap2.so.1
    • usr/lib/libc/libc_hwcap1.so.1
    • usr/lib/smbsrv/amd64/libfksmbsrv.so.1
    • usr/lib/smbsrv/libfksmbsrv.so.1
    • usr/lib/nfs/mountd
    • usr/lib/amd64/libzpool.so.1
    • usr/lib/libzpool.so.1
  • Date Encoded:
    • usr/sbin/iasl
    • usr/sbin/acpixtract
    • usr/sbin/acpidump
    • usr/bin/dns-sd
  • Text changes because I changed the headers:
    • usr/include/sys/sunndi.h
    • usr/include/sys/ddi_implfuncs.h
    • usr/include/sys/autoconf.h

Based on this we can see that there were no changes in the kernel or any of its modules

Actions #1

Updated by Electric Monk about 2 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 6205b5c44bad9044e168b06aef439c2e7cdc8a89

commit  6205b5c44bad9044e168b06aef439c2e7cdc8a89
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2020-04-22T08:57:10.000Z

    12508 ndi_devi_alloc() and friends could take const char * names
    Reviewed by: Yuri Pankov <ypankov@fastmail.com>
    Reviewed by: Patrick Mooney <pmooney@pfmooney.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF