Re: [PATCH V8 12/14] rust: Extend cpufreq bindings for driver registration

From: Alice Ryhl
Date: Thu Feb 06 2025 - 07:07:10 EST


On Thu, Feb 6, 2025 at 1:04 PM Danilo Krummrich <dakr@xxxxxxxxxx> wrote:
>
> On Thu, Feb 06, 2025 at 02:58:33PM +0530, Viresh Kumar wrote:
> > + unsafe { drop(KBox::from_raw(drv.attr)) };
>
> This could just be
>
> let _ = unsafe { KBox::from_raw(drv.attr) };
>
> At least drop() should not be within the unsafe block.

I think we usually write this as

drop(unsafe { KBox::from_raw(drv.attr) });

Alice