From: Uros Bizjak Date: Mon, 7 Oct 2024 08:48:04 +0000 (+0200) Subject: md/raid5-ppl: Use atomic64_inc_return() in ppl_new_iounit() X-Git-Tag: v6.13-rc1~211^2~39^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1e79892e76a78f33deecc895086bef92d8147183;p=thirdparty%2Flinux.git md/raid5-ppl: Use atomic64_inc_return() in ppl_new_iounit() Use atomic64_inc_return(&ref) instead of atomic64_add_return(1, &ref) to use optimized implementation and ease register pressure around the primitive for targets that implement optimized variant. Signed-off-by: Uros Bizjak Cc: Song Liu Cc: Yu Kuai Reviewed-by: Yu Kuai Reviewed-by: Artur Paszkiewicz Link: https://lore.kernel.org/r/20241007084831.48067-1-ubizjak@gmail.com Signed-off-by: Song Liu --- diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c index a70cbec12ed01..37c4da5311ca7 100644 --- a/drivers/md/raid5-ppl.c +++ b/drivers/md/raid5-ppl.c @@ -258,7 +258,7 @@ static struct ppl_io_unit *ppl_new_iounit(struct ppl_log *log, memset(pplhdr->reserved, 0xff, PPL_HDR_RESERVED); pplhdr->signature = cpu_to_le32(ppl_conf->signature); - io->seq = atomic64_add_return(1, &ppl_conf->seq); + io->seq = atomic64_inc_return(&ppl_conf->seq); pplhdr->generation = cpu_to_le64(io->seq); return io;