mirror of
https://github.com/torvalds/linux.git
synced 2025-01-01 15:51:46 +00:00
i2c: add a warning to i2c_adapter_depth()
This routine is only used together with lockdep for nested locking. The number of lock subclasses is limited to 8 as defined in lockdep.h Emit a warning if the adapter depth exceeds the maximum number of lockdep subclasses. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Acked-by: Peter Rosin <peda@axentia.se> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
a5ecddfe0b
commit
2771dc34dd
@ -1433,6 +1433,9 @@ unsigned int i2c_adapter_depth(struct i2c_adapter *adapter)
|
|||||||
while ((adapter = i2c_parent_is_i2c_adapter(adapter)))
|
while ((adapter = i2c_parent_is_i2c_adapter(adapter)))
|
||||||
depth++;
|
depth++;
|
||||||
|
|
||||||
|
WARN_ONCE(depth >= MAX_LOCKDEP_SUBCLASSES,
|
||||||
|
"adapter depth exceeds lockdep subclass limit\n");
|
||||||
|
|
||||||
return depth;
|
return depth;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(i2c_adapter_depth);
|
EXPORT_SYMBOL_GPL(i2c_adapter_depth);
|
||||||
|
Loading…
Reference in New Issue
Block a user