Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2853857pxu; Mon, 14 Dec 2020 12:29:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyzRt0Yd/yn4ShPDSNR2yBzPRFOEqR+qi+YHtIEKj5NIvZxnzT2aaMwlTf6n4OPvWN6/fp X-Received: by 2002:a05:6402:1041:: with SMTP id e1mr7343707edu.54.1607977746957; Mon, 14 Dec 2020 12:29:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607977746; cv=none; d=google.com; s=arc-20160816; b=Y7yVbHN8T/EPCQ1rk04HLqj9ZpESYNZ10Yfvpm2PhzXg8EU3PA8HK/rxGHRFKmcyy4 LM3zDa9rnJp6Bt2ulPSLaswvOjiy00lqaJ1dxlTz+JFJRe3GhPj/s1btqAOgH9liXoho 55+Sdt9vpdGUPZr4BTme6ff7KG9t8HnAFs/t8RQG2Q0YGt+psvAGknSE8oygRaWFZIOG DnqqtdBtl5wjNIVbBPe77hz8bNGJzCDq1dE2d3n8XFWzfKnrMyyr708F4k9EC90imubD sCc0lm8kXryPwE96opjBK2Kp0dmzdtdEHaapqsT6QRDgh/nfHawKq9zm3NAf3IeKu+iu okzA== 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=rwH2GiaQJ17bVtBdubcdWggC51NvJc7SNu3om5VaVgGLSQmVxzH5KReIXUFHD6d9xx 4qS/Fv3PLv3oOAAUo3iafkgttoCv/q+ra6CBF9iGTvHlP4Y79/DxqdpXoHHQXbG8IBuM ++cs2D5D3XRKaK7sGBY/EVKCmJy7KMkETex1XrghhJuM+znNgKzLwdpwMY8a6qpHOZkd pRO2FGxbQb4s+BJq/yM0Ev6FKcmyER3CXhUj9VIzCANaUfLGtUNF9on6SeAGO8bWCbl4 XQiUKQembLE6wVMUJ2yEG5wZZ5NMdIHBmN1cDQxuMaXO8jVScQoOt9/FIvxZM6WpYVXd FVXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jhWGEXIs; 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 n23si10057295ejr.321.2020.12.14.12.28.43; Mon, 14 Dec 2020 12:29:06 -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=jhWGEXIs; 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 S2503010AbgLNUVm (ORCPT + 99 others); Mon, 14 Dec 2020 15:21:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727855AbgLNUVH (ORCPT ); Mon, 14 Dec 2020 15:21:07 -0500 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F784C0613D6; Mon, 14 Dec 2020 12:20:27 -0800 (PST) Received: by mail-ej1-x644.google.com with SMTP id qw4so24334348ejb.12; Mon, 14 Dec 2020 12:20:27 -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=jhWGEXIsT7wblDPiUbRKmNvCe3+UbZDYw9Cb+ohgdlYrv+8fdsF80eF7JhLeVl3274 5r8mD1JVvM0ar8eDyXs58QDvYXVCQJNfMYyQT0q2k7256GBw9IolXB9D6NDEIyizE6tX i3EqNOLyUMO2j63q+o3xGD3/DFVAyee+qyUyqvHt10RiNin+ZHZiUWTRZLrVo7NTUUa+ UfEJ3dGTs92SQ7xM9j/YEV7Ja0IgFqcwNsQy87aYHK2M8WRFnaYSladHDHOVUfp0jG71 8VecjINNPfcMP9RmXVfpPIuYwZmbp7i9NZLpIiyKvKEgWnHNgOnwqmypsQjcWXXH8y0v EW/Q== 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=hvYk+0l0zunOuLqvYu7I+9k0U+fRoXetLQDNPAqSyBTyqrlxStMRh5p+bX+8jdzx3R VDbGS3rS0DYCBD26bE83QBvFfyEMjfhWFQhezASI7crPKog1wdGaOGs3c59/7ucIatdO +KgunUl8EQEi1gOAnCbQXuYKwZPKPR3nTffLXvoPQrw0zCuchAh/lHjDCmyQAGJ0uOGS DUFAUkp688zP263QOLy9pZvyP6hD4SPOprOgspMYmIMLmBFZy7pBikopm52ZTL9QyGRP 6Vkjlt+IeN9vJdOkM8wVWqluxEuzNCNVRkUxfDaBlGm4E2lyqusBWE+4Jrl+e1yE/qh0 9jtg== X-Gm-Message-State: AOAM533FDC8hFakFPfaEZ+15YRnrCK5uNV9JbET3wgNYQh+s0qT7d2DK 50sbAlH5vtiydUdM3N7M/SE= X-Received: by 2002:a17:906:4705:: with SMTP id y5mr23882838ejq.112.1607977225892; Mon, 14 Dec 2020 12:20:25 -0800 (PST) Received: from localhost.localdomain (ip5f5bfce9.dynamic.kabel-deutschland.de. [95.91.252.233]) by smtp.gmail.com with ESMTPSA id r7sm9334634edh.86.2020.12.14.12.20.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 12:20:25 -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, joe@perches.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/6] scsi: ufs: Remove stringize operator '#' restriction Date: Mon, 14 Dec 2020 21:20:09 +0100 Message-Id: <20201214202014.13835-2-huobean@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201214202014.13835-1-huobean@gmail.com> References: <20201214202014.13835-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