From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [linux-next:master 10231/11867] drivers/gpu/drm/xe/xe_configfs.c:282 lookup_engine_info() error: we previously assumed 'mask' could be null (see line 278)
Date: Wed, 24 Sep 2025 10:57:47 +0800 [thread overview]
Message-ID: <202509241020.mrKHkcLR-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Lucas De Marchi <lucas.demarchi@intel.com>
CC: Raag Jadav <raag.jadav@intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: ce7f1a983b074f6cf8609068088ca3182c569ee4
commit: e2a9854d806e1cb95861a0f3c7125caaefd7ef03 [10231/11867] drm/xe/configfs: Allow to select by class only
:::::: branch date: 10 hours ago
:::::: commit date: 5 days ago
config: i386-randconfig-141-20250923 (https://download.01.org/0day-ci/archive/20250924/202509241020.mrKHkcLR-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202509241020.mrKHkcLR-lkp@intel.com/
smatch warnings:
drivers/gpu/drm/xe/xe_configfs.c:282 lookup_engine_info() error: we previously assumed 'mask' could be null (see line 278)
vim +/mask +282 drivers/gpu/drm/xe/xe_configfs.c
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 256
e2a9854d806e1cb Lucas De Marchi 2025-09-16 257 /*
e2a9854d806e1cb Lucas De Marchi 2025-09-16 258 * Lookup engine_info. If @mask is not NULL, reduce the mask according to the
e2a9854d806e1cb Lucas De Marchi 2025-09-16 259 * instance in @pattern.
e2a9854d806e1cb Lucas De Marchi 2025-09-16 260 *
e2a9854d806e1cb Lucas De Marchi 2025-09-16 261 * Examples of inputs:
e2a9854d806e1cb Lucas De Marchi 2025-09-16 262 * - lookup_engine_info("rcs0", &mask): return "rcs" entry from @engine_info and
e2a9854d806e1cb Lucas De Marchi 2025-09-16 263 * mask == BIT_ULL(XE_HW_ENGINE_RCS0)
e2a9854d806e1cb Lucas De Marchi 2025-09-16 264 * - lookup_engine_info("rcs*", &mask): return "rcs" entry from @engine_info and
e2a9854d806e1cb Lucas De Marchi 2025-09-16 265 * mask == XE_HW_ENGINE_RCS_MASK
e2a9854d806e1cb Lucas De Marchi 2025-09-16 266 * - lookup_engine_info("rcs", NULL): return "rcs" entry from @engine_info
e2a9854d806e1cb Lucas De Marchi 2025-09-16 267 */
e2a9854d806e1cb Lucas De Marchi 2025-09-16 268 static const struct engine_info *lookup_engine_info(const char *pattern, u64 *mask)
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 269 {
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 270 for (size_t i = 0; i < ARRAY_SIZE(engine_info); i++) {
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 271 u8 instance;
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 272 u16 bit;
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 273
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 274 if (!str_has_prefix(pattern, engine_info[i].cls))
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 275 continue;
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 276
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 277 pattern += strlen(engine_info[i].cls);
e2a9854d806e1cb Lucas De Marchi 2025-09-16 @278 if (!mask && !*pattern)
e2a9854d806e1cb Lucas De Marchi 2025-09-16 279 return &engine_info[i];
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 280
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 281 if (!strcmp(pattern, "*")) {
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 @282 *mask = engine_info[i].mask;
e2a9854d806e1cb Lucas De Marchi 2025-09-16 283 return &engine_info[i];
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 284 }
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 285
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 286 if (kstrtou8(pattern, 10, &instance))
e2a9854d806e1cb Lucas De Marchi 2025-09-16 287 return NULL;
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 288
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 289 bit = __ffs64(engine_info[i].mask) + instance;
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 290 if (bit >= fls64(engine_info[i].mask))
e2a9854d806e1cb Lucas De Marchi 2025-09-16 291 return NULL;
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 292
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 293 *mask = BIT_ULL(bit);
e2a9854d806e1cb Lucas De Marchi 2025-09-16 294 return &engine_info[i];
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 295 }
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 296
e2a9854d806e1cb Lucas De Marchi 2025-09-16 297 return NULL;
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 298 }
d09bc3edfe5c702 Lucas De Marchi 2025-05-28 299
:::::: The code at line 282 was first introduced by commit
:::::: d09bc3edfe5c702463e2640314b7db2219242446 drm/xe/configfs: Add attribute to disable engines
:::::: TO: Lucas De Marchi <lucas.demarchi@intel.com>
:::::: CC: Lucas De Marchi <lucas.demarchi@intel.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-09-24 2:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202509241020.mrKHkcLR-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.