Re: drivers/hwtracing/stm/core.c:509:8-24: WARNING: stm_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open. (fwd)

From: Lorenzo Stoakes (ARM)

Date: Mon Nov 02 2026 - 06:14:38 EST


+cc Alex

On Mon, Nov 02, 2026 at 12:54:31AM +0100, Julia Lawall wrote:
> just forwarding. I don't know anything about this issue.
>
> julia

Thanks. This is unrelated to my change, looks like a cosmetic report that
predates it. Cc'd Alex, but not sure if any action is required.

Cheers, Lorenzo

>
> ---------- Forwarded message ----------
> Date: Mon, 02 Nov 2026 00:48:49 +0100
> From: kernel test robot <lkp@xxxxxxxxx>
> To: oe-kbuild@xxxxxxxxxxxxxxx
> Cc: lkp@xxxxxxxxx, Julia Lawall <julia.lawall@xxxxxxxx>
> Subject: drivers/hwtracing/stm/core.c:509:8-24: WARNING: stm_fops: .write() has
> stream semantic; safe to change nonseekable_open -> stream_open.
>
> BCC: lkp@xxxxxxxxx
> CC: oe-kbuild-all@xxxxxxxxxxxxxxx
> CC: linux-kernel@xxxxxxxxxxxxxxx
> TO: "Lorenzo Stoakes (Oracle)" <ljs@xxxxxxxxxx>
> CC: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> CC: Linux Memory Management List <linux-mm@xxxxxxxxx>
> CC: Suren Baghdasaryan <surenb@xxxxxxxxxx>
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
> commit: b0085cb94d2477787f4197a3000e33aabf3d48fc stm: replace deprecated mmap hook with mmap_prepare
> date: 7 months ago
> :::::: branch date: 2 hours ago
> :::::: commit date: 7 months ago
> config: mips-randconfig-r2106-20261101 (https://download.01.org/0day-ci/archive/20261102/202611020009.xkUfJUpm-lkp@xxxxxxxxx/config)
> compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 8f6b51ca8bab1d49006ddaa042bc7e4e7306975d)
>
> 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
> | Fixes: b0085cb94d24 ("stm: replace deprecated mmap hook with mmap_prepare")
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Reported-by: Julia Lawall <julia.lawall@xxxxxxxx>
> | Closes: https://lore.kernel.org/r/202611020009.xkUfJUpm-lkp@xxxxxxxxx/
>
> cocci warnings: (new ones prefixed by >>)
> >> drivers/hwtracing/stm/core.c:509:8-24: WARNING: stm_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
>
> vim +509 drivers/hwtracing/stm/core.c
>
> c7fd62bc69d022 Alexander Shishkin 2018-10-05 484
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 485 static int stm_char_open(struct inode *inode, struct file *file)
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 486 {
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 487 struct stm_file *stmf;
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 488 struct device *dev;
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 489 unsigned int major = imajor(inode);
> a0ebf519b8a266 Johan Hovold 2016-11-18 490 int err = -ENOMEM;
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 491
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 492 dev = class_find_device(&stm_class, NULL, &major, major_match);
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 493 if (!dev)
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 494 return -ENODEV;
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 495
> bf4afc53b77aea Linus Torvalds 2026-02-21 496 stmf = kzalloc_obj(*stmf);
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 497 if (!stmf)
> a0ebf519b8a266 Johan Hovold 2016-11-18 498 goto err_put_device;
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 499
> a0ebf519b8a266 Johan Hovold 2016-11-18 500 err = -ENODEV;
> cde4ad8368840e Alexander Shishkin 2016-02-15 501 stm_output_init(&stmf->output);
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 502 stmf->stm = to_stm_device(dev);
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 503
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 504 if (!try_module_get(stmf->stm->owner))
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 505 goto err_free;
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 506
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 507 file->private_data = stmf;
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 508
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 @509 return nonseekable_open(inode, file);
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 510
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 511 err_free:
> a0ebf519b8a266 Johan Hovold 2016-11-18 512 kfree(stmf);
> a0ebf519b8a266 Johan Hovold 2016-11-18 513 err_put_device:
> f7c81c7176c72c Alexander Shishkin 2016-02-15 514 /* matches class_find_device() above */
> f7c81c7176c72c Alexander Shishkin 2016-02-15 515 put_device(dev);
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 516
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 517 return err;
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 518 }
> 7bd1d4093c2fa3 Alexander Shishkin 2015-09-22 519
>
> :::::: The code at line 509 was first introduced by commit
> :::::: 7bd1d4093c2fa37d1ecab05da3c9d48ea2af2264 stm class: Introduce an abstraction for System Trace Module devices
>
> :::::: TO: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
> :::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

--
Cheers, Lorenzo