mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
mm/cma: replace snprintf with strscpy in cma_new_area
Replace snprintf("%s", ...) with the faster and more direct strscpy().
Link: https://lkml.kernel.org/r/20260126174516.236968-1-thorsten.blum@linux.dev
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: SeongJae Park <sj@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
e2c3b6b21c
commit
ad789a85b1
1 changed files with 2 additions and 1 deletions
3
mm/cma.c
3
mm/cma.c
|
|
@ -22,6 +22,7 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/sizes.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/string_choices.h>
|
||||
#include <linux/log2.h>
|
||||
#include <linux/cma.h>
|
||||
|
|
@ -233,7 +234,7 @@ static int __init cma_new_area(const char *name, phys_addr_t size,
|
|||
cma_area_count++;
|
||||
|
||||
if (name)
|
||||
snprintf(cma->name, CMA_MAX_NAME, "%s", name);
|
||||
strscpy(cma->name, name);
|
||||
else
|
||||
snprintf(cma->name, CMA_MAX_NAME, "cma%d\n", cma_area_count);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue