All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 6206/13220] lib/zstd/decompress/zstd_decompress_block.c:982:69-70: WARNING opportunity for swap()
@ 2021-11-07  7:28 kernel test robot
  2021-11-07  7:28 ` [PATCH] lib: zstd: fix swap.cocci warnings kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-11-07  7:28 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]

CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Nick Terrell <terrelln@fb.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   6a37ebbe07bf72cd5fd791d67a664f37c8f17a13
commit: ecea7adad80d9d230df766345e5f8061792da00d [6206/13220] lib: zstd: Upgrade to latest upstream zstd version 1.4.10
:::::: branch date: 30 hours ago
:::::: commit date: 4 weeks ago
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


cocci warnings: (new ones prefixed by >>)
>> lib/zstd/decompress/zstd_decompress_block.c:982:69-70: WARNING opportunity for swap()

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 42202 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] lib: zstd: fix swap.cocci warnings
  2021-11-07  7:28 [linux-next:master 6206/13220] lib/zstd/decompress/zstd_decompress_block.c:982:69-70: WARNING opportunity for swap() kernel test robot
@ 2021-11-07  7:28 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-11-07  7:28 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]

CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Nick Terrell <terrelln@fb.com>

From: kernel test robot <lkp@intel.com>

lib/zstd/decompress/zstd_decompress_block.c:982:69-70: WARNING opportunity for swap()


 Check for opencoded swap() implementation.

Generated by: scripts/coccinelle/misc/swap.cocci

Fixes: ecea7adad80d ("lib: zstd: Upgrade to latest upstream zstd version 1.4.10")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   6a37ebbe07bf72cd5fd791d67a664f37c8f17a13
commit: ecea7adad80d9d230df766345e5f8061792da00d [6206/13220] lib: zstd: Upgrade to latest upstream zstd version 1.4.10
:::::: branch date: 30 hours ago
:::::: commit date: 4 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 zstd_decompress_block.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/lib/zstd/decompress/zstd_decompress_block.c
+++ b/lib/zstd/decompress/zstd_decompress_block.c
@@ -978,9 +978,7 @@ ZSTD_decodeSequence(seqState_t* seqState
                 if (LIKELY(!ll0))
                     offset = seqState->prevOffset[0];
                 else {
-                    offset = seqState->prevOffset[1];
-                    seqState->prevOffset[1] = seqState->prevOffset[0];
-                    seqState->prevOffset[0] = offset;
+                    swap(seqState->prevOffset[1], seqState->prevOffset[0]);
                 }
             } else {
                 offset = ofBase + ll0 + BIT_readBitsFast(&seqState->DStream, 1);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-07  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-07  7:28 [linux-next:master 6206/13220] lib/zstd/decompress/zstd_decompress_block.c:982:69-70: WARNING opportunity for swap() kernel test robot
2021-11-07  7:28 ` [PATCH] lib: zstd: fix swap.cocci warnings 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.