Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1391466rwp; Thu, 13 Jul 2023 10:07:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlGdzAPdBzIRzdNiikIp1uPlNm7kHiLQziQzyavRvGFSLrhzTkI+h0aYGeLlM9FVXAM5Xqob X-Received: by 2002:a19:915e:0:b0:4fb:744e:17db with SMTP id y30-20020a19915e000000b004fb744e17dbmr1690912lfj.1.1689268059760; Thu, 13 Jul 2023 10:07:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689268059; cv=none; d=google.com; s=arc-20160816; b=Ebyd1VFn5e9EC7RGoE/d62BqP7IWgXrZsjQu2eFOsV9Fgh7qnYw5eUvJAvEwPxLFRq JBrSyXYkgVXmTS1pMTn4mae5ohPrRVKBsYEhZYkSARH2Qw7BcUW2kPH1nYgjlaCfAcaD pzdscgu4g70j/m43NftQSRzR75fWhlitOJol4/otr1S/FMKvtErucppTrxtLOnvyH6wj fDQDZrQHSNWad1ayB21/5W7jIScytVqqePO9x/KGTD6EPLOG9Z+ZZ19MYxgIL2RAfdZ+ sFgwtCV7vrzxuU7nufoTfs5kLBKuztKXSGTQFQnnbEwiLvgcGgIVQaad+H7s9VXFNfUX YA1w== 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=/CYHsJHkAPOgOy4IDXYU5w+VojxE3561vOD18ijZg9Q=; b=OYB4uh8iToLp4lwNfxDy0kTZ8IjezngoC0TXZXXkiJOz7pC/GmhQMmY8e/a+AHm2NA f8OQ+hAfbuh2HGm267ZSwW6xWS9Eb+O9qH/Yf08BUBieEMOeiZoeHDjuFTP1dE/UvEDw PPYVAAqrQunsH1xpkwKNTOi/JeEYuVY/T9SnZ0ah//A1qy/ExmvXyGynNWGLIdmwtlL3 6AKAQv8ZLsm/p+jlJytgt/bEl8vzmI/3mDF7Uli0XYicIqt7UujUvC5mMvldhTHsNAii QsG4X+IKwVD3s/k0xFarQ33blYZjO+9VlKV4QRcsxo4xEuRj+aMqu0IWR+HOxf2SYpJm D0RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=j84zOzS2; 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 c5-20020a056402120500b0051e1654f831si7191900edw.453.2023.07.13.10.07.15; Thu, 13 Jul 2023 10:07:39 -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=j84zOzS2; 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 S235278AbjGMQhw (ORCPT + 99 others); Thu, 13 Jul 2023 12:37:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234497AbjGMQhU (ORCPT ); Thu, 13 Jul 2023 12:37:20 -0400 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F6B92D47 for ; Thu, 13 Jul 2023 09:36:58 -0700 (PDT) Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-346129c9512so1948605ab.1 for ; Thu, 13 Jul 2023 09:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689266216; x=1691858216; 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=j84zOzS2UdE9+xPQXLUCHUex2P5pCyffe4WuGd1a5TD9mNcJ3dfkxSd0JWEcrmKK3p FsN52We9fV2omZa9UTDcqgaDUazFxwF3PhwXq8kuFKlLKAHU8jlF2UG+nitlQWarAtRB SQAswSd2N5CMlwNXtfBIlzg51uROWTE+9wIKl/pY7nwagOoH9+NNZukDTeBKk3uSXd1g BsCCFDamozGg3oBsY5uQqVrGjGa7pwxon538wE1rQzY9doyU5eJNfIaDSFJbKbTlna5n MwlLLEDDfw01PI6/2ba8Zs3D75BG21Bn6VZr9c7GmAaC5gTfgadse9rfrAlHWoi7eX8u YpDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689266216; x=1691858216; 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=gFYJVIijex34RYRQbHdOZveSuS0JTZlFbdU4aiF9inUMKIoTVDf0TI0JAV2RMYI3Si hGlmLrlU00ENmL74tkrHH3SoccrHeSeugtwnWbXADBpKQ7IeUA0qrlw1NiS9HNHMVCOU l+mTowhJWyvQHD1g/8n6CRg+7Jz1P1qlzy+DXIhdBfgCRKvGuk0B64+cHhOoO8hdbdDB /Wz3mJi8CSWUmnMCFz7zbuKUeCz7iX2WeAeTHI3KnRqzIz4baAovCdFofzy8mFhI05bx sPz7y8TPcDOQEHoyLLeScud1YNSnqDUtvuA6Mw/FIEu2bEBPhQ42RQT0vAfRqYKCulLu 81zQ== X-Gm-Message-State: ABy/qLaT3Od0SoTZcwzg++aa2JOSxbvsq0IOBMdUgu7Lx3F2eFHLRDgG Hd+VcP+hbJzlZioOwLzr2hA= X-Received: by 2002:a05:6e02:66f:b0:341:24f1:3f74 with SMTP id l15-20020a056e02066f00b0034124f13f74mr132294ilt.14.1689266215917; Thu, 13 Jul 2023 09:36:55 -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 s7-20020a92d907000000b00345950d7e94sm2147571iln.20.2023.07.13.09.36.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 09:36:55 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, daniel.vetter@ffwll.ch, 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: jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, gregkh@linuxfoundation.org, Jim Cromie Subject: [PATCH v4 10/21] dyndbg: tighten ddebug_class_name() 1st arg type Date: Thu, 13 Jul 2023 10:36:15 -0600 Message-ID: <20230713163626.31338-11-jim.cromie@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230713163626.31338-1-jim.cromie@gmail.com> References: <20230713163626.31338-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