Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2680284pxu; Mon, 14 Dec 2020 08:23:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzL/dDC69hd89dpvv3BQXcFjMDsMwGBUGAiePu1oDujjb76aUeYvhw2VKTnyJedBl55hThe X-Received: by 2002:a17:906:5847:: with SMTP id h7mr4292494ejs.124.1607962987974; Mon, 14 Dec 2020 08:23:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607962987; cv=none; d=google.com; s=arc-20160816; b=GZDORPvig1dfpQnMB2VflMCcVeYpHod8o4Q4qHclEiOL9lSN43vDEGvs6TLXU5Cxoy 7MJDXBn0ftw9Ttcn0BnPEzOyGHi1FM+RtCMbKiack6nfAhLWiRFZY4Q18Th+qESul16c PBw3K90n/ekBhXd6Hh12hNBX78GS4n2k3BjaAj6oMg5R4JQLs9RG+nmTTLUJ+UGanaHI 8R3Q55GqlsfMy4JiL6uI7ffkMF/mlL0fbzQe7SjN07STNyh1M1quQZQd4FE/Ps0LH8ae LA5v+Kz2+HFPH2En5K9Co3QTbovsEpG5OuJQtqYwouWt/biImTuw/3jw5TngVLwH0cGk s8Vw== 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=B8DG8sj0mVxCy24G0WJAp1ENLV6t+4B+o+Ikvj584D4=; b=cozgmkY7kCpL7FlcNjMDNZuhWpvawkTM2EH/pYP8fKQffnTkMIAaFG6t8wzEcFB1Bf yT7hvEyrb3xWSlWsknB2zR6ZSSUJCOUJlGKPEz66Vvv9WkzBD+CFu7wx6l6df0VdyoK/ 7eRUA4W68qgx/Xn1EJjEk/hOTpMWFlcHRkrAr26OL90j+7aMM6gPEoO4/trCn7bfaoQX 3e1Rde/icezbhVE1Hwtz66jUy7up2xdkicdUUiXNuCAM/LP2QKXET+jfQ65tn8PCdQj7 2oLQPVbpxfIkQD3nEunc2Mipsh8FoyR80AaoIuiT55CCs3C7Fx50+G08567yNNh5BJRq eKOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eN+aMYX5; 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 zc8si10031334ejb.662.2020.12.14.08.22.44; Mon, 14 Dec 2020 08:23:07 -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=eN+aMYX5; 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 S2440158AbgLNQTG (ORCPT + 99 others); Mon, 14 Dec 2020 11:19:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2501917AbgLNQQK (ORCPT ); Mon, 14 Dec 2020 11:16:10 -0500 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCDEBC0613D6; Mon, 14 Dec 2020 08:15:29 -0800 (PST) Received: by mail-ed1-x544.google.com with SMTP id q16so17704904edv.10; Mon, 14 Dec 2020 08:15:29 -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=B8DG8sj0mVxCy24G0WJAp1ENLV6t+4B+o+Ikvj584D4=; b=eN+aMYX5vrpcSavcggl/T03qrpR/2Dc75fFYYBdC07KkMUIMJlVf0O/3Hpg+geqscT feqLPv3IbRdrK00+KT2Gx5XsgCJOSxDde+726N2ajSexy2oR2V/LuPNwM4XWbSSICEMX cudrSFIaH1K8wF5YKLMr7IvHrR1QHk0E6Cpn1HniBJ/+di3LPzqCf81zwvgMi07iNe4I zcToSVF5KSRjNPlSVSWqAngnIztqOTBVLQEqTLdW2gMWnhUxUZkw6bespgXBRA/0jgu4 Hl2sOoMzEBpQgklu7zaClQ6KygAzkzGFnkVlCwagFH1x9DTWJDa1fMPULgqhy6TDplc3 /zWg== 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=B8DG8sj0mVxCy24G0WJAp1ENLV6t+4B+o+Ikvj584D4=; b=qk3G/Mfd3AvcH3aJ2GtyI3kfgB1thA4TG+dIuV8m+YQQCbJ/GGcXptEbDutj3/PczV z8WceFtNLMobkLGUU71WKDVty0WRgMqjeTqDuTLcCn4SC25t0IRaJ8MHxs17q7CPRy7f eEG0Ah0ENQnBw1uo16duTehBQWrkxKJR0tg+e+d3/LAeqIaXRlA7w4TKOvdLr6j8KC4T ciueA7defore/pQfC9oHct19wUe7dR9UgeH/HaxR9imw8MdjLAXxu/e4ziTsA6UQANGJ AowsTULDY1wizuvTHjI1PlqfOQ0Zai4OO5kVyZGcL4U3S7ugJEKvR+Z1zEuYj2gmthT+ jREQ== X-Gm-Message-State: AOAM532LwzNMqgww3UEbN+bVGBL9ekqPQLt5Q8t+zRDBqzr4cfcGI/ga P8kcIOZgzi9LWdC6R5xUvHM= X-Received: by 2002:a05:6402:1a30:: with SMTP id be16mr26006248edb.124.1607962528678; Mon, 14 Dec 2020 08:15:28 -0800 (PST) Received: from localhost.localdomain (ip5f5bfce9.dynamic.kabel-deutschland.de. [95.91.252.233]) by smtp.gmail.com with ESMTPSA id i13sm6646056edu.22.2020.12.14.08.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 08:15:28 -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 v2 1/6] scsi: ufs: Remove stringize operator '#' restriction Date: Mon, 14 Dec 2020 17:14:57 +0100 Message-Id: <20201214161502.13440-2-huobean@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201214161502.13440-1-huobean@gmail.com> References: <20201214161502.13440-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. 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..84e16868bb39 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