Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5993439rwb; Tue, 1 Aug 2023 10:38:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlHzi/cCjWydNzoSjL3R3XOqEUplaKt36ehPZfhSHRDlNL3xSGzQ8NK0PT7EiKDtAtUO6gp3 X-Received: by 2002:a17:906:20d9:b0:99b:c830:cf23 with SMTP id c25-20020a17090620d900b0099bc830cf23mr3069641ejc.27.1690911522629; Tue, 01 Aug 2023 10:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690911522; cv=none; d=google.com; s=arc-20160816; b=VPFJRQQa1wtT7SND/NnP71E4VHpNf6kJO2KFzILjMdZ49BjW7IZ57ky/JNFBqFtYCS OcVFXOR4veIkSaM7VR9pupWIjeAhYxEmQl2IqWfsewKHYapdYK6WENwkqWW1GATL2Bsm noEwS7DfpJBe9ygOMPBIBpc31h1OvLrCcF/0Ngc1fXa8G+yRFYTmb1c64GTVRX3p6hzG BGkiyJ5rLYDb2tCdkclX88bLmC5t/68TglnKu55mw4lAdtqHbsATYMAvMuFjY+4EYWPn 0FhzUxbhUrjVmvWRJUVwQo+3gPPd8OzQ0Z+LYMKqBKcJ4gTHTxJov4owFH7NRx58SYhz jMIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9fCryleot7DYJMVCUstKegVHZxdFt0UcbYK1dV/Zx9Y=; fh=u5vE1TE1dJB7o4IGsVvua16vnF8dhcoUHNlJ2pbkr7c=; b=LlC6Hzom9tqJqUBTLODAvqiqb2PHYKn0R8v0lr2x0zVhhGlQhrAhi9irhHhswPT/RC eT3wIL+hj/4zIVZqo3SN2V8doBgK2tkHw/D5MR/vM++AyAQuVa86eXcR/WEqNHrdEXMm MJdZ4QI3qh9wKKckHONrM4egycQaycffDOk3zk+jdRoVw6cF8pvuNk7mOug8+Wgs1DaK bWNhEUbtT1CA4CB08hUaVR6rinZ6mbzeeed5CRB+LJrxMEpYnXSSMEHqDQLgObjYyDLw oU97AUCd1ic6Gefr9LodXmD1/6uY5AzhnOIhedq53YbKSBgpWVK86H7/I8ar/RsH88M0 8g0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=kROfNG8L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w26-20020a170906131a00b00987b0a5f325si8379081ejb.1043.2023.08.01.10.38.17; Tue, 01 Aug 2023 10:38:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=kROfNG8L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234153AbjHAREQ (ORCPT + 99 others); Tue, 1 Aug 2023 13:04:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234133AbjHARDp (ORCPT ); Tue, 1 Aug 2023 13:03:45 -0400 Received: from mail-oo1-xc2c.google.com (mail-oo1-xc2c.google.com [IPv6:2607:f8b0:4864:20::c2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2D0A2D74 for ; Tue, 1 Aug 2023 10:03:30 -0700 (PDT) Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-56c85b723cfso1898166eaf.3 for ; Tue, 01 Aug 2023 10:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690909409; x=1691514209; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9fCryleot7DYJMVCUstKegVHZxdFt0UcbYK1dV/Zx9Y=; b=kROfNG8LDRCn7UgNyAgqsZx6rWtyVz4JtO0DqGP4BXmprbgnYl0ZfixoqPBvhGkHOU EU95RXDWQ9rUb+HVd3GNUq5Hhbfo+Jd63RduLoThfH63By1HGzM3fIIxH5EYZOA3fk1t xOSTQM1hGCm9bPNXS8l7jMFe1NzNjNFOXY+5SkbgAmGdOlrhPlkff3D8T+xCJJVVxMZj jSey6N4JABae7aNdBp+Z9ivpSWuvs286z11haAnSUP+OoJ14dm8baX2yH1+ViERfCHyf Pm6D9+hWoxJ40Q/bygWehp4Y0CPgMIZXI7WopcauzC6ikHCTgD5CIAQpne4kQVO0JQKY rXwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690909409; x=1691514209; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9fCryleot7DYJMVCUstKegVHZxdFt0UcbYK1dV/Zx9Y=; b=iXxBSxzBx/3naLGdQx1hZTig7N820AUlm/ELHjuViOnrwEZGo2fYxWE/vNFYQYupZI 8AI3THwQRjoowAi1IpMzFdeZXTcUHd048WayhVJrvj0h7UczEG5ZdbVbJ1O3OQQcuajA eBr5lZN42qyKdZ4Ml2p1PIZihGQNdkYgfvXR/z2T5vkq+cDZRRspNlqMr73lvPM4YoRJ /SoT3HeN6jitrEfRBiO0m2/4Z8+PsA4IVJNy5caKprhRJ8DeyjGqJil7gXDS1VszqOzG SdygZ/90+bdRWX23L8+kaFAD1DgaqbPT7XMYCeA6Qh1BRqVOz8q4wzk6dbFm8K1WVjvC S+Sw== X-Gm-Message-State: ABy/qLZgm699jov+2cjN21r+YqlAPFY48pXGIraOlEA6kdotKeH3vNl9 WnZvX8rKw68FWDxWQyHsbqo= X-Received: by 2002:a05:6870:82a4:b0:1be:d3a1:fd9 with SMTP id q36-20020a05687082a400b001bed3a10fd9mr7622319oae.9.1690909409285; Tue, 01 Aug 2023 10:03:29 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id o20-20020a02c6b4000000b0042b144abf71sm3768577jan.179.2023.08.01.10.03.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 10:03:28 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, daniel@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: linux@rasmusvillemoes.dk, joe@perches.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, Jim Cromie Subject: [PATCH v5 10/22] dyndbg: tighten ddebug_class_name() 1st arg type Date: Tue, 1 Aug 2023 11:02:42 -0600 Message-ID: <20230801170255.163237-11-jim.cromie@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230801170255.163237-1-jim.cromie@gmail.com> References: <20230801170255.163237-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change function's 1st arg-type, and deref in the caller. The fn doesn't need any other fields in the struct. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index a8973d1a6896..f392f692b452 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1112,12 +1112,12 @@ static void *ddebug_proc_next(struct seq_file *m, void *p, loff_t *pos) #define class_in_range(class_id, map) \ (class_id >= map->base && class_id < map->base + map->length) -static const char *ddebug_class_name(struct ddebug_iter *iter, struct _ddebug *dp) +static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddebug *dp) { - struct ddebug_class_map *map = iter->table->classes; - int i, nc = iter->table->num_classes; + struct ddebug_class_map *map = dt->classes; + int i; - for (i = 0; i < nc; i++, map++) + for (i = 0; i < dt->num_classes; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; @@ -1151,7 +1151,7 @@ static int ddebug_proc_show(struct seq_file *m, void *p) seq_puts(m, "\""); if (dp->class_id != _DPRINTK_CLASS_DFLT) { - class = ddebug_class_name(iter, dp); + class = ddebug_class_name(iter->table, dp); if (class) seq_printf(m, " class:%s", class); else -- 2.41.0