From nobody Sun Feb 8 21:26:38 2026 Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3066931B123 for ; Mon, 22 Dec 2025 10:39:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766399980; cv=none; b=Z53K7dRt9TQ5afiHGOFqvwLiPDg6rpXEloHg/0w6+if5GHZDnBtwauc29rmCNvoEHCLX40a2YzmKB9X3hcIlBJzpSkFJzO/DAgiab9ThvZlfgJqOMCkKNfOQ+51q5LUCqWfVpjtCfvl2LCEexkqHi+DuFjL80+2/knF+F3AJ2Ks= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766399980; c=relaxed/simple; bh=6Kvj3j+JyJmJF6ph6iYiZFbe9YKpPNnW9BRw/TBVIZU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FIfDVq+Ki29YJst7carhXQwPUx9Fy5Wu242AxpqLLClRrCPb3P8AKbxV3fnuav2Y0AgwntsC4Ic9V3pMaeuaQXGsKm1BSCSztBRXWPePwAuJtsOqlV9Rl7gKh4c7jFCUfq7l4VT3hrHcge+YEpDbpl7XfrhkNCeUzb6DatVyfRo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=XG6p1UvU; arc=none smtp.client-ip=95.215.58.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="XG6p1UvU" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1766399974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=T/InfEgh1rmD6E2r53FYi8cfzL8MFjJ0vajZYP9KyzM=; b=XG6p1UvUhBaB0Q7XPYnOwdnSYikJw2IUozrP/5WyeXO23P+T2RknRzl3ueb2rtiN3fJEQU y4q2JdvjmGrWm2eFXOW2TphfV19wB1g0KcTAKYHhoM9bAnFrggAhBCODJ2H5TiGzxd8gb+ XEmF6J6xB75vYCHLBxeZlnnsmiG+x3Y= From: Thorsten Blum To: Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle Cc: Thorsten Blum , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] s390/cmm: Use max to simplify cmm_timer_fn Date: Mon, 22 Dec 2025 11:39:17 +0100 Message-ID: <20251222103917.635026-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Use max() to replace the open-coded version and simplify cmm_timer_fn(). Signed-off-by: Thorsten Blum --- arch/s390/mm/cmm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index 06512bc178a5..fa1318d748b1 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -212,10 +213,7 @@ static void cmm_timer_fn(struct timer_list *unused) long nr; =20 nr =3D cmm_timed_pages_target - cmm_timeout_pages; - if (nr < 0) - cmm_timed_pages_target =3D 0; - else - cmm_timed_pages_target =3D nr; + cmm_timed_pages_target =3D max(0, nr); cmm_kick_thread(); cmm_set_timer(); } --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4