]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drivers/base/memory: simplify outputting of valid_zones_show()
authorShiyang Ruan <ruansy.fnst@fujitsu.com>
Wed, 8 Jan 2025 01:52:23 +0000 (09:52 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 28 Feb 2025 00:59:38 +0000 (16:59 -0800)
commit673b7fea7b09f1814d38010a8e0b564b79dd686a
treeb9b53d14922dd87cd213d77a9cc08aa3ace95041
parent14805bf14ec14880f96d3ac6719500fbad5edfe9
drivers/base/memory: simplify outputting of valid_zones_show()

No need to specify position at the first writing to the buf because the
@len is always 0 at this time.  Use sysfs_emit() instead to simplify it.
Also avoid setting/checking default_zone with a conditional operator.

Link: https://lkml.kernel.org/r/20250108015223.1522887-1-ruansy.fnst@fujitsu.com
Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/base/memory.c