From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (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 543DA442FB6 for ; Tue, 11 Aug 2026 12:20:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450811; cv=none; b=M0vSCc9WqnBic9oszzE51EaALwJuME3zNO1+S3hAyiPKomD/O0bIFPZ+4o2Qwcs+2qhtpHY2NBkAB+GnbC2JUW1MuLaYj2VVu4ChNn8UV9UPMuEdxboPBWUSCqIgCrB7R4G+BooINfYbCH+v5ScUTU1CU7lHOUZouqEaNRJw8k4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450811; c=relaxed/simple; bh=IRgXuL2HEt972Mb2mEbeRlQabmXtbOr5I2EF/C55K18=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KbYRtEz3pyeuMJCSlMNky83cI99LVxl/kJ7hO1ue99MZeWgKl6nTqKyd9i9qonSsMMc1mBoE1Q8d9W5d8SXAQPfLrH2eqDWvIPDdZKw7nBVKUK9Fh/5ZBsaec2rA4HBhfsSDJlfXdsarK3pAtHy1+TaqOF3tfDhaNTOc1O4JCF8= 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=JfGfePlt; arc=none smtp.client-ip=91.218.175.185 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="JfGfePlt" 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=1786450808; 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: in-reply-to:in-reply-to:references:references; bh=A/TnPWmuMKH0EjkO+dSTtE0bfI9IzVnHwZRMi8O0fKc=; b=JfGfePltUOOvW5CegoRg9Z2aZhV7UKUPmyvN8TcnSF/rYJhuDPDxZH21EY2q/AGLHUls8y MhdQhoakq0cxotbNuOIVDAOUFGZFbBJZvxL/EhNp8+qj4/KfRQAz+4qplHntbppp0iGh9P DQGNWSZFr+GOr2yXI2SJTdF0Kqhsw7A= From: Yuntao Wang To: Jason Baron , Jim Cromie Cc: Andrew Morton , linux-kernel@vger.kernel.org, Yuntao Wang Subject: [PATCH 2/2] dyndbg: clean up dynamic_debug_init() to improve readability Date: Tue, 11 Aug 2026 20:18:31 +0800 Message-ID: <20260811121831.577848-3-yuntao.wang@linux.dev> In-Reply-To: <20260811121831.577848-1-yuntao.wang@linux.dev> References: <20260811121831.577848-1-yuntao.wang@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: 8bit X-Migadu-Flow: FLOW_OUT Keep variable assignments in the same order throughout the function to make the code easier to follow. No functional changes. Signed-off-by: Yuntao Wang --- lib/dynamic_debug.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 16fad5454d6a..49334d1aa4b3 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1442,28 +1442,29 @@ static int __init dynamic_debug_init(void) i = mod_sites = mod_ct = 0; for (; iter < __stop___dyndbg; iter++, i++, mod_sites++) { - if (strcmp(modname, iter->modname)) { - mod_ct++; - di.num_descs = mod_sites; di.descs = iter_mod_start; + di.num_descs = mod_sites; ret = ddebug_add_module(&di, modname); if (ret) goto out_err; - mod_sites = 0; - modname = iter->modname; + mod_ct++; + iter_mod_start = iter; + modname = iter->modname; + mod_sites = 0; } } - mod_ct++; - di.num_descs = mod_sites; di.descs = iter_mod_start; + di.num_descs = mod_sites; ret = ddebug_add_module(&di, modname); if (ret) goto out_err; + mod_ct++; + ddebug_init_success = 1; vpr_info("%d prdebugs in %d modules, %d KiB in ddebug tables, %d kiB in __dyndbg section\n", i, mod_ct, (int)((mod_ct * sizeof(struct ddebug_table)) >> 10), -- 2.55.0