* fs/hfsplus/unicode.c:496:24-25: WARNING opportunity for swap()
@ 2026-11-17 16:30 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-17 16:30 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Julia Lawall
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Viacheslav Dubeyko <slava@dubeyko.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 666539eecdf4db623f5e3c3e55cf9f2dfad24aa4
commit: bbe5ebcbc006ac3c7353759fc593fb7cb7de76a1 hfsplus: canonicalize decomposed catalog names like fsck_hfs expects
date: 8 weeks ago
:::::: branch date: 23 hours ago
:::::: commit date: 8 weeks ago
config: arm64-randconfig-r2109-20261116 (https://download.01.org/0day-ci/archive/20261117/20261117172832.VeDFg2Mm-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 5637411ce5dc86d0b7f87cde0f7ee47406d29db6)
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: bbe5ebcbc006 ("hfsplus: canonicalize decomposed catalog names like fsck_hfs expects")
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/20261117172832.VeDFg2Mm-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> fs/hfsplus/unicode.c:496:24-25: WARNING opportunity for swap()
vim +496 fs/hfsplus/unicode.c
afd6c9e1f5287a Ernesto A. Fernández 2018-08-21 461
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 462 /*
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 463 * Apply the Unicode Canonical Ordering Algorithm to a decomposed name held
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 464 * as plain host-order code units: within each maximal run of characters
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 465 * that have a nonzero combining class, stable-sort the run into ascending
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 466 * combining-class order. A character with combining class 0 always starts
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 467 * a new run and is never itself reordered.
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 468 *
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 469 * hfsplus_decompose_table decomposes each source character on its own; it
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 470 * says nothing about how the decompositions of two different source
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 471 * characters should be ordered relative to each other when both produce
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 472 * combining marks that end up adjacent. Without this pass, such a
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 473 * sequence can be stored in an order that macOS's own fsck_hfs
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 474 * (FixDecomps() in CatalogCheck.c) considers illegal, even though every
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 475 * individual character was decomposed correctly.
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 476 */
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 477 static void hfsplus_canonical_reorder(u16 *ustr, int len)
1e96b7ca1e8f17 Duane Griffin 2007-07-15 478 {
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 479 int i;
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 480
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 481 for (i = 1; i < len; i++) {
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 482 u8 cls = hfsplus_combining_class(ustr[i]);
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 483 int j = i;
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 484
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 485 if (!cls)
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 486 continue;
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 487
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 488 while (j > 0) {
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 489 u8 prev_cls = hfsplus_combining_class(ustr[j - 1]);
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 490 u16 tmp;
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 491
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 492 if (!prev_cls || prev_cls <= cls)
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 493 break;
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 494
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 495 tmp = ustr[j];
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 @496 ustr[j] = ustr[j - 1];
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 497 ustr[j - 1] = tmp;
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 498 j--;
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 499 }
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 500 }
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 501 }
bbe5ebcbc006ac Viacheslav Dubeyko 2026-09-18 502
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-17 16:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 16:30 fs/hfsplus/unicode.c:496:24-25: WARNING opportunity for swap() kernel test robot
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.