YhLu <YhLu(a)tyan.com> writes:
What is the difference between
printk_debug("smbus: %s[%d]->", dev_path(dev->bus->dev),
printk_debug("smbus: %s[%d]->%s", dev_path(dev->bus->dev),
dev->bus->link , dev_path(dev));
the first print
smbus: PCI: 01:01.1->I2C: 50
the second one print
smbus: PCI: 01:01.1-> PCI: 01:01.1
dev_path returns the address of a statically allocated buffer
that it puts the path in. That address is always the same.
So multiple calls to dev_path before printing the path are a
I had a hard time balancing convenience and safety when
If we need to fix this likely there are 2 possibilities.
1) Pass dev_path the address of a buffer, to write into.
2) Update printk to have a special format flag that
performs the actions of dev_path.
Except for being a gotcha to watch out for I think we are ok.