Thread (49 messages) 49 messages, 5 authors, 2023-10-09

Re: [PATCH v2 1/3] rust: core abstractions for network PHY drivers

From: Trevor Gross <tmgross@umich.edu>
Date: 2023-10-09 03:08:06
Also in: rust-for-linux

On Sun, Oct 8, 2023 at 10:28 AM FUJITA Tomonori
[off-list ref] wrote:
quoted
Fujita - since this doesn't get exposed, could this be pub(crate)?)
Device? I don't think so. If we make Device pub(crate), we need to
make trait Driver pub(crate) too.
Not `Device`, just `pub fn from_raw`. I think it is fine as-is (I see
you sent a new version)
quoted
Fujita, I think we started doing comments when we know that
lossy/bitwise `as` casts are correct. Maybe just leave the code as-is
but add

    // CAST: the C side verifies devnum < 32
Ok. As I commented on the RFC reviewing, I don't think that we
need try_from conversion for values from PHYLIB. Implementing bindings
for untrusted stuff doesn't make sense.

https://lore.kernel.org/all/20230926.101928.767176570707357116.fujita.tomonori@gmail.com/ (local)

On the other hand, I think that it might worth to use try_from for
set_speed() because its about the bindings and Rust PHY drivers.
However, I leave it alone since likely setting a wrong value doesn't
break anything.
Agreed, thanks for the followup
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help