Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp328231pxu; Tue, 5 Jan 2021 12:05:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrDbq/2SQ2qHffG2pjTvLWRqfVJDxgRdzTLCkwJnClSKcGwTQZA8tgxb+WHptsfgbcqlUj X-Received: by 2002:a17:907:94c6:: with SMTP id dn6mr672531ejc.13.1609877132284; Tue, 05 Jan 2021 12:05:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609877132; cv=none; d=google.com; s=arc-20160816; b=r3VE8enBRSr01hJj6pT8Xu2O4t9MB32xX8Lt8OXLstyRXviXlZWFDY7yKUd/+s+XZh RYVzgWbXI2K7L3v195TG19J4O77aEcyaLivqTuAzwpATgybwnoAP3eUTOljzs58qySLI h8mFwFGWOMUkO+8p2t3sM0XZPECqXbHFEAIa3wUuIMeJlanFRgzN+Yc6gs1J3CszF86z Feo2xGBf0K93fe8M7Xk2QFX318eJDDFFVxhw9SvRSjCUoHncC68Xh9opVXnZFUyhcoK5 njnRPYJpd2nNhcEZu09Am5CtKBfElw/2C0lary/5Bq+JoNjkPCD1ErsXZYsrMgn5s+VM tgGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=e2p6ovsTZi3RI/1s5tiOcO3cGPDLijFKcdx9hDvuso4=; b=vU1AB1/wWVS4t10x+Yyfdl1ewraDCEFjaYYXS9HaAPscqgSH6EBhxNWHn1YjLRCZwd o6lwVwWNryEVvV0ggwz43syThuasvgGosWJB+IVJFq5vy3MN0RYkatgsLxWP3PQQJuJY aSY0TrzEHhkgMVBHoTrhrbB8hKNRqvzSGmriUneH+W1aHn9knYbgg8J33kmks+OmOjMV 7kWTJHX11dSjEfku6gE6owTiOPqabEZbskb2NwqWj2LAXp+WErgu+sks7ryzeUk452Ac eTANFzpDTP+7EYzhY68ke1c86QAxBfDo33ddgKYer3/+Eh2FMBgrUSecFiHuqV/0Rl8O y3Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mvl8QMjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si26580edr.433.2021.01.05.12.05.09; Tue, 05 Jan 2021 12:05:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mvl8QMjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1729640AbhAELfn (ORCPT + 99 others); Tue, 5 Jan 2021 06:35:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbhAELfl (ORCPT ); Tue, 5 Jan 2021 06:35:41 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED258C061793; Tue, 5 Jan 2021 03:35:00 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id ce23so40766411ejb.8; Tue, 05 Jan 2021 03:35:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e2p6ovsTZi3RI/1s5tiOcO3cGPDLijFKcdx9hDvuso4=; b=mvl8QMjfZO453TDy57JBtq+f9vo+IKpPgpPqfKfxYTGbpqY2AY4tcyQ8jCJYoz0AXh kUb7tuu6R4GZ3CQCdzx3j6ENYHcKPP6rWq+NPhGD7B9AEIT4PXXCLoVxlFDugmkXpgnm JIqVMuDKssSJeF0nsI0Hp6G3ZCEVAK5b+LOyN1Wr5BwSvREwYbgd/uOoj2vCoraXtW8G 27TIre7dbgMbJrxWu0BY7MKy8wyHKM/KY4n2W/MFmUFODUubKB2tCN2GToh2dzrqhOIe IRe1lm37yFrdPuabLwbfqHdT7hiGSgN2W7NEgF224qmDxanDZDNR7WYDlKN1gfmcD/2m 7XDQ== 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=e2p6ovsTZi3RI/1s5tiOcO3cGPDLijFKcdx9hDvuso4=; b=cv0ymkywyTRke4nUswTYGURIWxpVKuWaPSe80McFxMntAL1q0So0uR1Fl8mjQVaxHK VUSxm5UhodzJFmrd0Ww/MDt6Q/N6A2jWCmCifeA44rzFMSiS2bTTjQioA5jBN0V39hbH C0KUVzlbdrWpZ+N1HHKvslYC2dzeaauj6FYlqRsWW3MVdc8Czt2d8taEyEUVQcjkSPyH s1o/G3ElxyA1qAl3qMjhgm0ikY87fkvlUQrRK7AG45sO0iMPzy39nufv3eVTeyxUjy+8 /SN6d2fnRVnqJZj9YOum8g98K3kHUJb7uB0BJgrsfarJjMhkwOJoFFxVCAi1sheZ7RBu zkgA== X-Gm-Message-State: AOAM530gM7n3fVGknApMfxN3kKEGcxnUD10hsyeWRMFnSdx3WmgxWs0p FzIeCO8WnXJVCPiZaccNy08= X-Received: by 2002:a17:906:f9da:: with SMTP id lj26mr68670285ejb.467.1609846499675; Tue, 05 Jan 2021 03:34:59 -0800 (PST) Received: from localhost.localdomain (ip5f5bfcff.dynamic.kabel-deutschland.de. [95.91.252.255]) by smtp.gmail.com with ESMTPSA id n17sm24640772ejh.49.2021.01.05.03.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jan 2021 03:34:59 -0800 (PST) From: Bean Huo To: alim.akhtar@samsung.com, avri.altman@wdc.com, asutoshd@codeaurora.org, jejb@linux.ibm.com, martin.petersen@oracle.com, stanley.chu@mediatek.com, beanhuo@micron.com, bvanassche@acm.org, tomas.winkler@intel.com, cang@codeaurora.org, rostedt@goodmis.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/6] scsi: ufs: Remove stringize operator '#' restriction Date: Tue, 5 Jan 2021 12:34:41 +0100 Message-Id: <20210105113446.16027-2-huobean@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210105113446.16027-1-huobean@gmail.com> References: <20210105113446.16027-1-huobean@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bean Huo Current EM macro definition, we use stringize operator '#', which turns the argument it precedes into a quoted string. Thus requires the symbol of __print_symbolic() should be the string corresponding to the name of the enum. However, we have other cases, the symbol and enum name are not the same, we can redefine EM/EMe, but there will introduce some redundant codes. This patch is to remove this restriction, let others reuse the current EM/EMe definition. Acked-by: Steven Rostedt (VMware) Signed-off-by: Bean Huo --- include/trace/events/ufs.h | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/include/trace/events/ufs.h b/include/trace/events/ufs.h index 0bd54a184391..fa755394bc0f 100644 --- a/include/trace/events/ufs.h +++ b/include/trace/events/ufs.h @@ -20,28 +20,28 @@ { SYNCHRONIZE_CACHE, "SYNC" }, \ { UNMAP, "UNMAP" }) -#define UFS_LINK_STATES \ - EM(UIC_LINK_OFF_STATE) \ - EM(UIC_LINK_ACTIVE_STATE) \ - EMe(UIC_LINK_HIBERN8_STATE) - -#define UFS_PWR_MODES \ - EM(UFS_ACTIVE_PWR_MODE) \ - EM(UFS_SLEEP_PWR_MODE) \ - EM(UFS_POWERDOWN_PWR_MODE) \ - EMe(UFS_DEEPSLEEP_PWR_MODE) - -#define UFSCHD_CLK_GATING_STATES \ - EM(CLKS_OFF) \ - EM(CLKS_ON) \ - EM(REQ_CLKS_OFF) \ - EMe(REQ_CLKS_ON) +#define UFS_LINK_STATES \ + EM(UIC_LINK_OFF_STATE, "UIC_LINK_OFF_STATE") \ + EM(UIC_LINK_ACTIVE_STATE, "UIC_LINK_ACTIVE_STATE") \ + EMe(UIC_LINK_HIBERN8_STATE, "UIC_LINK_HIBERN8_STATE") + +#define UFS_PWR_MODES \ + EM(UFS_ACTIVE_PWR_MODE, "UFS_ACTIVE_PWR_MODE") \ + EM(UFS_SLEEP_PWR_MODE, "UFS_SLEEP_PWR_MODE") \ + EM(UFS_POWERDOWN_PWR_MODE, "UFS_POWERDOWN_PWR_MODE") \ + EMe(UFS_DEEPSLEEP_PWR_MODE, "UFS_DEEPSLEEP_PWR_MODE") + +#define UFSCHD_CLK_GATING_STATES \ + EM(CLKS_OFF, "CLKS_OFF") \ + EM(CLKS_ON, "CLKS_ON") \ + EM(REQ_CLKS_OFF, "REQ_CLKS_OFF") \ + EMe(REQ_CLKS_ON, "REQ_CLKS_ON") /* Enums require being exported to userspace, for user tool parsing */ #undef EM #undef EMe -#define EM(a) TRACE_DEFINE_ENUM(a); -#define EMe(a) TRACE_DEFINE_ENUM(a); +#define EM(a, b) TRACE_DEFINE_ENUM(a); +#define EMe(a, b) TRACE_DEFINE_ENUM(a); UFS_LINK_STATES; UFS_PWR_MODES; @@ -53,8 +53,8 @@ UFSCHD_CLK_GATING_STATES; */ #undef EM #undef EMe -#define EM(a) { a, #a }, -#define EMe(a) { a, #a } +#define EM(a, b) {a, b}, +#define EMe(a, b) {a, b} TRACE_EVENT(ufshcd_clk_gating, -- 2.17.1