]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lib/bch.c: use swap() to improve code
authorThorsten Blum <thorsten.blum@toblux.com>
Mon, 8 Jul 2024 22:40:24 +0000 (00:40 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 12 Jul 2024 23:39:53 +0000 (16:39 -0700)
commite1fb7430fcb00431087fc1c088ec9e8737cf6c7d
tree6d9f4801057f9cdcf190bbb1520427a1e04e1840
parent4f5d4a1ba7a1a23173e356186f3f8b7c27d2e948
lib/bch.c: use swap() to improve code

Use the swap() macro to simplify the functions solve_linear_system() and
gf_poly_gcd() and improve their readability.  Remove the local variable
tmp.

Fixes the following three Coccinelle/coccicheck warnings reported by
swap.cocci:

  WARNING opportunity for swap()
  WARNING opportunity for swap()
  WARNING opportunity for swap()

Link: https://lkml.kernel.org/r/20240708224023.9312-2-thorsten.blum@toblux.com
Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/bch.c