md/raid5-ppl: Use atomic64_inc_return() in ppl_new_iounit()
PATCH 1/1 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.
--- drivers/md/raid5-ppl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/raid5-ppl.c +1 -1
@@ -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;
Signature · 1 line
2.46.2
Quoted 7 lines · Uros Bizjak
Use
atomic64_inc_return(&ref)instead ofatomic64_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 <[email protected]>Cc Song Liu <[email protected]>Cc Yu Kuai <[email protected]>
LGTM
Quoted 18 lines
--- drivers/md/raid5-ppl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/md/raid5-ppl.c +1
-1@@ -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;
Quoted 7 lines · Uros Bizjak
Use
atomic64_inc_return(&ref)instead ofatomic64_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 <[email protected]>Cc Song Liu <[email protected]>Cc Yu Kuai <[email protected]>
Quoted 11 lines · Artur Paszkiewicz
Quoted 7 lines · Uros Bizjak
Use
atomic64_inc_return(&ref)instead ofatomic64_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 <[email protected]>Cc Song Liu <[email protected]>Cc Yu Kuai <[email protected]>Reviewed-by Artur Paszkiewicz <[email protected]>
Applied to md-6.13. Thanks for the patch!
Song