Project

General

Profile

Bug #9986

ddi_prop_lookup(9F) family should accept const property name

Added by Joshua M. Clulow 11 months ago. Updated 10 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
kernel
Start date:
2018-11-18
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

The ddi_prop_lookup family of functions (e.g., ddi_prop_lookup_string(), etc) accept a char *name value naming the property the caller wishes to fetch. These functions don't (and should not!) modify the provided name value, so we should declare that parameter as a const char * instead. The manual page will need to be updated as well.

History

#1

Updated by Jeff Walsh 10 months ago

I was having a look through this as a bite-size bug, however chaining through the const qualifiers in functions calls leads us to ddi_prop_op/ cb_prop_op. and so it creates a list of drivers to fix up, which I am prepared to do, however I'm not sure if that was the intention of the change.

#2

Updated by Joshua M. Clulow 10 months ago

It seems that it might be reasonable to do at least two different things:

  • fix up just the ddi_prop_lookup family, managing the casting away of const within the DDI
  • make the broader change you're describing, which will probably need more testing or at least serious use of wsdiff to confirm that program text isn't unduely changing as a result

Either one seems reasonable, depending on how much effort is available and how risky the change ends up being!

Also available in: Atom PDF