From patchwork Tue Sep 11 21:49:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 146487 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4097038ljw; Tue, 11 Sep 2018 14:50:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZeFQCRug81RpxWeZsvvO+sD03KIxmhgm24kEmiZManucGs4G1mUuJMkGR8IWI+wuem8dUP X-Received: by 2002:a63:b00f:: with SMTP id h15-v6mr30888545pgf.442.1536702610104; Tue, 11 Sep 2018 14:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536702610; cv=none; d=google.com; s=arc-20160816; b=NqBeinmisVMOdS9CcVHiCskfMEKr6mncuzZPb3kVt7CSGylVxtrVWSOXSB4w5CTBXe CEACvoDiphcgXHpYxCE8uSwTfATMgAv+sGu+LKBCtN3bMeM4IgUFGWbANSgkfLP3FfcS HdTfde/06hMRta3RTPqourtd56I/Um2xHq4w8JkIqTf1pqoTDcBIhxNNLQcdP4tdU+Bh F+0IUdoIRJwJ3uXL6v0vL1C6bABcvwtXmC7cpaBlXij5A2lUAK4s248s67uZajPZP2ih ozFVzl4BF2XeIy6lPITYtF4K3gvbOkKWmJjB8BkV7EYyT74MbkrL/aez9Lo2r45oTojN UpzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=tc0VYjzvtrRhZoxEZG72ESoXO/EpMMtSV0pE/TDCzIM=; b=xQv+R3tnv086vGn54vZPsfhGJvFOyo8Sh4I8yoHZp7yt+0cbJvd45dYXu0/Bwdux9n ecDBEhX9fUQnHw/9Ag0UMEwtxeX0r5m1zO7ntHB9Y3ukRJBBWBXGY1WPc9TdYQg67Vdt dXjHUQ6/lK0vbOw8ydu7kjPTI+V8aO6JiYahRQtKrpRhQDCX36nByK6OCQjNS5CuVj2T twCzBLCmr1OHJZYH+o7A+lh/m4fNTpzni1k4Q9xV+ks6liw4diE0LuJuXyh5Dg1ITaFP yTgkTQfmpIXvxQaozMOk6xzio32e2muZzzykXWOi4MfENJCBLz+Zg6tBtLcFTe3Rk1aO LaAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UOvi4H/7"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p23-v6si19049813plr.423.2018.09.11.14.50.09; Tue, 11 Sep 2018 14:50:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UOvi4H/7"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728321AbeILCvY (ORCPT + 32 others); Tue, 11 Sep 2018 22:51:24 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:51295 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728281AbeILCvX (ORCPT ); Tue, 11 Sep 2018 22:51:23 -0400 Received: by mail-it0-f65.google.com with SMTP id e14-v6so334100itf.1 for ; Tue, 11 Sep 2018 14:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tc0VYjzvtrRhZoxEZG72ESoXO/EpMMtSV0pE/TDCzIM=; b=UOvi4H/7QiAkS7olTEsrymcYzbNylgXc0bqLDh/8tKTcI3g+T+HNs7yMUbnJKRxh1h 43OeqtxoQt+nxKMoMv7vkswTJim03nmHf4kpRYiLDB2fQxS2O09ywBsOJEexqaDEMJfx Hc1SiyqstJOXDyKggOkcDfVMxGezoNd3ETIQg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tc0VYjzvtrRhZoxEZG72ESoXO/EpMMtSV0pE/TDCzIM=; b=lYYcdrw7ovTf7/z/TYQW5Bx7b+BBMVM3wrBE+vcvBZAJ9ORhUccnSlUeQc4QkOHpdx yJ42F08a1BH9NhqS2tAvAE/tj3LbCljLbWT4puQaNZFASbVWKm2OBKxCf+F/yIVmOveb SWbbefmwweodHKyXMbGVajwdJjPnG7W/CUlxsJWT1rBkAeoQQfqW2FHxWGrvGuLosV3T kdZluTirCLY1wE2yFONfvJKPG2qiOxvN/P6TwcKMAib2qseFoDa2K7qKNL+qDH41hay/ eqZnVW0PglGdiMXDblJTBwlkHUdtrUTQ9hFdH/a25yoBgrgdPZsQg+/7mLV/9yoGCXqy kQ8A== X-Gm-Message-State: APzg51B8ZuixXztEdrDTi7HbgFl3XPXRxKAZNaPgs04qxYidq2SPCRVo 1eYeePRLI7F0Y3EaoZ6zupndaA== X-Received: by 2002:a02:88ad:: with SMTP id n42-v6mr23854655jaj.38.1536702606424; Tue, 11 Sep 2018 14:50:06 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id c3-v6sm1102172itd.8.2018.09.11.14.50.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Sep 2018 14:50:05 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: alexander.shishkin@linux.intel.com, suzuki.poulose@arm.com, gregkh@linuxfoundation.org, kim.phillips@arm.com, leo.yan@linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] coresight: Define macro to replace dev_dbg() boiler plate code Date: Tue, 11 Sep 2018 15:49:54 -0600 Message-Id: <1536702595-9999-5-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536702595-9999-1-git-send-email-mathieu.poirier@linaro.org> References: <1536702595-9999-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using a macro is much better than repeating the same code everywhere in the drivers. That way it is easy to keep debug output messages confined to the sysFS mode of operation. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-priv.h | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h index acfe67646a05..8a7a197cba69 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h @@ -7,6 +7,7 @@ #define _CORESIGHT_PRIV_H #include +#include #include #include #include @@ -74,6 +75,12 @@ enum cs_mode { CS_MODE_PERF, }; +#define coresight_dev_dbg(dev, mode, format, ...) \ +do { \ + if (mode == CS_MODE_SYSFS) \ + dev_dbg(dev, format, ##__VA_ARGS__); \ +} while (0) + /** * struct cs_buffer - keep track of a recording session' specifics * @cur: index of the current buffer