public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Gary Guo" <gary@kernel.org>, "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Tamir Duberstein" <tamird@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev, rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rust: disallow use of `CStr::as_ptr`
Date: Thu, 22 Jan 2026 11:57:21 +0100	[thread overview]
Message-ID: <202601221157.89t3Sqbl-lkp@intel.com> (raw)
In-Reply-To: <20260121165835.4097975-1-gary@kernel.org>

Hi Gary,

kernel test robot noticed the following build warnings:

[auto build test WARNING on rust/rust-next]
[also build test WARNING on next-20260121]
[cannot apply to linus/master v6.16-rc1]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Gary-Guo/rust-disallow-use-of-CStr-as_ptr/20260122-014335
base:   https://github.com/Rust-for-Linux/linux rust-next
patch link:    https://lore.kernel.org/r/20260121165835.4097975-1-gary%40kernel.org
patch subject: [PATCH] rust: disallow use of `CStr::as_ptr`
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20260122/202601221157.89t3Sqbl-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260122/202601221157.89t3Sqbl-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601221157.89t3Sqbl-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> warning: use of a disallowed method `core::ffi::CStr::as_ptr`
   --> rust/kernel/task.rs:422:54
   |
   422 |         unsafe { crate::bindings::__might_sleep(file.as_ptr().cast(), loc.line() as i32) }
   |                                                      ^^^^^^ help: Kernel's `char` is always unsigned. Use `as_char_ptr` instead.: `kernel::prelude::CStrExt::as_char_ptr`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods
   = note: `-W clippy::disallowed-methods` implied by `-W clippy::all`
   = help: to override `-W clippy::all` add `#[allow(clippy::disallowed_methods)]`

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

      parent reply	other threads:[~2026-01-22 10:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21 16:58 [PATCH] rust: disallow use of `CStr::as_ptr` Gary Guo
2026-01-21 17:04 ` Miguel Ojeda
2026-01-21 17:33   ` Gary Guo
2026-01-21 18:11     ` Miguel Ojeda
2026-01-21 17:55 ` Tamir Duberstein
2026-01-21 18:19   ` Gary Guo
2026-01-21 19:45     ` Tamir Duberstein
2026-01-21 20:01       ` Gary Guo
2026-01-21 20:01         ` Tamir Duberstein
2026-01-21 20:47           ` Miguel Ojeda
2026-01-22  8:28 ` Alice Ryhl
2026-01-22 10:57 ` kernel test robot [this message]

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=202601221157.89t3Sqbl-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=gary@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@gmail.com \
    --cc=tmgross@umich.edu \
    /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