]> 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>
Tue, 4 Mar 2025 05:49:29 +0000 (21:49 -0800)
commit2ce1b44c6df87614fd27fd5d3b292f7f701b3d01
tree8c89712cf3a11844e013300c00ed22a6df8d8391
parent65ffcf3a198559d35fef0fe51c1068e1baa92f7f
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