Remove Device::from_raw()
in favor of using Device::as_ref()
+ into()
.
#1088
Labels
Device::from_raw()
in favor of using Device::as_ref()
+ into()
.
#1088
First, there is an inconsistency between
Device::from_raw()
andARef::from_raw()
on whether the refcount gets increased or not. That meansDevice::from_raw()
should be renamed. Moreover, as suggested here,Device::from_raw()
can be avoid by usingunsafe { Device::as_ref(ptr) }.into()
. Things need to be done:Device::from_raw()
.Device::as_ref()
and probablyARef
as wellThis requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes, to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and so on. Please see https://docs.kernel.org/process/submitting-patches.html and https://rust-for-linux.com/contributing for details.
Please take this issue only if you are new to the kernel development process and you would like to use it as a test to submit your first patch to the kernel. Please do not take it if you do not plan to make other contributions to the kernel.
The text was updated successfully, but these errors were encountered: