public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Miguel Ojeda <ojeda@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Danilo Krummrich <dakr@kernel.org>, Gary Guo <gary@garyguo.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Wedson Almeida Filho <walmeida@microsoft.com>
Subject: Re: linux-next: manual merge of the rust tree with the char-misc tree
Date: Mon, 11 Nov 2024 15:54:10 +0100	[thread overview]
Message-ID: <2024111102-baffling-budding-1d7d@gregkh> (raw)
In-Reply-To: <20241111173459.2646d4af@canb.auug.org.au>

On Mon, Nov 11, 2024 at 05:34:59PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the rust tree got a conflict in:
> 
>   rust/macros/module.rs
> 
> between commit:
> 
>   7f15c46a57c3 ("rust: introduce `InPlaceModule`")
> 
> from the char-misc tree and commit:
> 
>   d072acda4862 ("rust: use custom FFI integer types")
> 
> from the rust tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc rust/macros/module.rs
> index a03266a78cfb,e7a087b7e884..000000000000
> --- a/rust/macros/module.rs
> +++ b/rust/macros/module.rs
> @@@ -332,15 -330,21 +332,15 @@@ pub(crate) fn module(ts: TokenStream) -
>                       /// # Safety
>                       ///
>                       /// This function must only be called once.
> -                     unsafe fn __init() -> core::ffi::c_int {{
> +                     unsafe fn __init() -> kernel::ffi::c_int {{
>  -                        match <{type_} as kernel::Module>::init(&super::super::THIS_MODULE) {{
>  -                            Ok(m) => {{
>  -                                // SAFETY: No data race, since `__MOD` can only be accessed by this
>  -                                // module and there only `__init` and `__exit` access it. These
>  -                                // functions are only called once and `__exit` cannot be called
>  -                                // before or during `__init`.
>  -                                unsafe {{
>  -                                    __MOD = Some(m);
>  -                                }}
>  -                                return 0;
>  -                            }}
>  -                            Err(e) => {{
>  -                                return e.to_errno();
>  -                            }}
>  +                        let initer =
>  +                            <{type_} as kernel::InPlaceModule>::init(&super::super::THIS_MODULE);
>  +                        // SAFETY: No data race, since `__MOD` can only be accessed by this module
>  +                        // and there only `__init` and `__exit` access it. These functions are only
>  +                        // called once and `__exit` cannot be called before or during `__init`.
>  +                        match unsafe {{ initer.__pinned_init(__MOD.as_mut_ptr()) }} {{
>  +                            Ok(m) => 0,
>  +                            Err(e) => e.to_errno(),
>                           }}
>                       }}
>   

Looks good to me, thanks!

greg k-h


  reply	other threads:[~2024-11-11 14:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11  6:34 linux-next: manual merge of the rust tree with the char-misc tree Stephen Rothwell
2024-11-11 14:54 ` Greg KH [this message]
2024-11-11 23:56   ` Miguel Ojeda
2024-11-28  1:48 ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2022-05-16  7:13 Stephen Rothwell
2022-05-16  7:49 ` Greg KH
2022-05-16  8:18   ` Miguel Ojeda
2022-05-16  8:27     ` Greg KH
2021-04-16  7:58 Stephen Rothwell
2021-04-16  8:10 ` Greg KH
2021-04-16  8:26 ` Stephen Rothwell
2021-04-16 12:31 ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2024111102-baffling-budding-1d7d@gregkh \
    --to=greg@kroah.com \
    --cc=arnd@arndb.de \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=walmeida@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox