Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932196AbdCIMDY (ORCPT ); Thu, 9 Mar 2017 07:03:24 -0500 Received: from mail-cys01nam02on0063.outbound.protection.outlook.com ([104.47.37.63]:18757 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754515AbdCIMDS (ORCPT ); Thu, 9 Mar 2017 07:03:18 -0500 Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=cavium.com; Date: Thu, 9 Mar 2017 13:02:46 +0100 From: Robert Richter To: Aleksey Makarov Cc: Will Deacon , Robin Murphy , Joerg Roedel , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] iommu/arm-smmu: Report smmu type in dmesg Message-ID: <20170309120246.GQ16822@rric.localdomain> References: <20170306135833.21455-1-rrichter@cavium.com> <4a991323-1059-5f3c-0aa3-0ab0cb7bd3f1@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4a991323-1059-5f3c-0aa3-0ab0cb7bd3f1@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [92.229.91.73] X-ClientProxiedBy: HE1PR0802CA0018.eurprd08.prod.outlook.com (10.172.123.156) To CY1PR07MB2346.namprd07.prod.outlook.com (10.166.194.145) X-MS-Office365-Filtering-Correlation-Id: aafdc0a2-5541-4076-d652-08d466e43adb X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2346; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2346;3:ylz/hjPFPrmfcXrHktXicWcCCGPkfLST8f8LcdXh59ShrtXKv7Rvo8wz3vvE6FplyXS/eon85h/IIRjYcZbthU7KdE5F1iJO4t+hn/jkky6wPy5upqFCyttslyPAy5NaNQcikaHdX3Npn2/VPU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8ouG/olbWacSZHDwz3Dky9cshATcQyY3myOfXHn5hAYY6eyFX8QEMejwrwl/Kmpbymq465J2iSUONjVCI4Hw5r/KBdIfC6pP+nb/gfkNsRJ7IMl2bu2Yb7fJrOmfrkY93RhjAw9QhMq+Af0SYmxc3jX7kXIwf09aFzOZB5V/TLGv+fKxmbF0y8Xy8ncxOwplvPkLyilfrQVeI5iDXl7d8BwAf52C5kxH95aIG3UEymdQvL8DFI4Xq3AlGxdWNzxQFD11p4vgT64piDmUJZRyRdCGAQBB1xAjji59iYAoYHxCjrqrblsPNoM4pcZHpkib/MEblqdPUA+HwIm8LIqEWnNuXeQnZYwXdva/57ehT2IIkO2 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123558025)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(6072148);SRVR:CY1PR07MB2346;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2346; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2346;4:0JmdEGI7YU7mDccGZBrNK7C/xglMYRdty6oCEk6gRmeIbmFChuXT6wTx4BxqJFqgyZA1JqV4SuXiVh+QQKBQzydb3cHPRh/GkuUEkR+x3lBNzv5OMDkraoaZ5Our2uipJ2JdsyE646FG+mxMeEhFxGNMxm20MQHX3ZolmPuoyyNnv91+goOh3+ZNif75Q28OVIEXVViEpo2eOauGlVeXWxz2+qoR+/Wz+pLrYtwLH0SQ6N8DpRrqJ8IpUS4bnCBqlhNSsfpvTdobGItkwpZln8bFC0USlxxoUxI4Xdql7+MnxTeiGse48rgYyCqiVMw176vrK+i3hfa5MtZW0SSfQ1BAF7r7q4kBx1bPzIaBwUEG4YDquOxWf3/6OmNTeVbWcYitOViGMjt+zY3p/tHmR8wpO7q0y4R1JSfFRi5x7hYLTRAiu2JcJsFP99qPZSLpbCutvPHze7nKYygFDK7XC5ZhQrVq6/5yp++sE5THHpWpKvF6CI2O9ZSnLzj2Vjiz+DvaKgdynl+E80qLpIe+qImtUtB34hyOir0jzBE2RyFoGwPNrmHG1XOuo1la9Tzdy3esSQuTldC7UkWz/BxsHMJiHB9Euo6gZE/TZPJJ4b0= X-Forefront-PRVS: 0241D5F98C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39450400003)(24454002)(9686003)(54906002)(55016002)(4326008)(42186005)(6916009)(6506006)(2950100002)(33656002)(6246003)(6666003)(189998001)(53546006)(110136004)(38730400002)(54356999)(76176999)(50986999)(25786008)(23726003)(229853002)(83506001)(305945005)(7736002)(6116002)(50466002)(3846002)(2906002)(1076002)(5660300001)(66066001)(8676002)(81166006)(86362001)(47776003)(4001350100001)(53936002)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2346;H:rric.localdomain;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR07MB2346;23:C2fcU6lUbgspZrD1hp/6zKjiDHoc/SOO2dYR10/Tv?= =?us-ascii?Q?QaYDY8/2wbH70fnnErO0bEpqztMRTbiyVWxVLbQ3C6c7zVNbHEZiB2L2cl7u?= =?us-ascii?Q?D9wxXVbCcIhhIwoBI4NTOcpxbaajAMrKjPQOPF6Y752yVMQejDUO/OOtDQYr?= =?us-ascii?Q?m4SF9CGSX64uDo+Uu0j5xNUPhho6KoqUOXTjVk/qrJyBCwqxjT8eZ0L+v4pH?= =?us-ascii?Q?UdTnaykLHwUBRWccdTbyxeYhVEqzC50kJ08GZvXDDyjd1FzRoYK8M7zDP5DL?= =?us-ascii?Q?P9VWFbGNHuo2iSm0qmL5UPBKsJPvJYeqywHoxIWluU+HNzcfvl6ttrKXG1wc?= =?us-ascii?Q?7HJvaLovY6iCYUuNYYs4amObxhJk4vtLV9TxOSw09ciJG3Fx9fGIg1UK7akP?= =?us-ascii?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lpRKX51vXfKZdEzI0ieUWdFLhPR1u656Kw2SH9MutFVwVVhG9DP9lbgrVNYTSPET8YUlg8q/3OAJT9FCHUEtXEK/mLuL0w2T3X0fkWpk85TxqcIlfKDn2AwVLEs58cPBr+f2P4rXloOiHyFu3rk9SjnN2zKebRnKuuv88GU1Ulh71Cefe0P0tJ0TY+qGDeMnH/e+zIhqg==;5:VYwRYvXl6CX5qWKete8CZSY/DvdTDtwZppvpNVXKnl25CCCer+OcTXIijACb5TuKbhTTuTwT4F4VEDxzMx6ANqeaYWw+oMSGdaFAMOIGnynyEaiwyvLMfBom/P5MlPwV3hrAeBwYpOG4F2OHr4R81sCzsslK8wG4RuUWo3eef0w=;24:p+FeBIoBUX0O7uczObK/4YZquVev7S9rTvSM6PekXylbTwwLyhelHd996BIGithHweKaisIFi96ZhIV3hNdr+K1joaXip6ZT1yhV610FTos= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2346;7:RBnYfauxvCXk0AHS2wJjrFhgvG4yhMzvS45WSGIXxQ+hP7oswCqkK5u5qjo8JCnKV5go56O+ijSBMv/Bp+7AmvwnhilWmSDlZWP5a8buswRyCXEKZfpjB/Pqr4j7XAyJ6RTByKqOKBhw6IusIucYVr4ooqMaAn29mh+JOQ+GHpzohxY8cKka8fbrTcjP3aAlNlsa74cUnMhqImYroM22u4KRrQtgH7q536GGeuJKItTOFiKDMOlMGRImZexib1uqTEmo7ZTVfMzCgjZTcdp9N0zRn8EqnSTgAHQIUoIwZGTnyDNWaL69S+nfbjUZgKKnEBWQvGvXau5JY/6Rs4BnZQ== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2017 12:02:57.1675 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2346 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1389 Lines: 30 On 08.03.17 16:25:24, Aleksey Makarov wrote: > >-#define ARM_SMMU_MATCH_DATA(name, ver, imp) \ > >-static struct arm_smmu_match_data name = { .version = ver, .model = imp } > >+#define ARM_SMMU_TYPE(var, ver, imp, _name) \ > >+static struct arm_smmu_type var = { .version = ver, .model = imp, .name = _name } > > Can we infer the _name from the name of var? > > #define ARM_SMMU_TYPE(var, ver, imp) \ > static struct arm_smmu_type var = { .version = ver, .model = imp, .name = #var } > > >-ARM_SMMU_MATCH_DATA(smmu_generic_v1, ARM_SMMU_V1, GENERIC_SMMU); > >-ARM_SMMU_MATCH_DATA(smmu_generic_v2, ARM_SMMU_V2, GENERIC_SMMU); > >-ARM_SMMU_MATCH_DATA(arm_mmu401, ARM_SMMU_V1_64K, GENERIC_SMMU); > >-ARM_SMMU_MATCH_DATA(arm_mmu500, ARM_SMMU_V2, ARM_MMU500); > >-ARM_SMMU_MATCH_DATA(cavium_smmuv2, ARM_SMMU_V2, CAVIUM_SMMUV2); > >+ARM_SMMU_TYPE(smmu_generic_v1, ARM_SMMU_V1, GENERIC_SMMU, "smmu-generic-v1"); > >+ARM_SMMU_TYPE(smmu_generic_v2, ARM_SMMU_V2, GENERIC_SMMU, "smmu-generic-v2"); > >+ARM_SMMU_TYPE(arm_mmu401, ARM_SMMU_V1_64K, GENERIC_SMMU, "arm-mmu401"); > >+ARM_SMMU_TYPE(arm_mmu500, ARM_SMMU_V2, ARM_MMU500, "arm-mmu500"); > >+ARM_SMMU_TYPE(cavium_smmuv2, ARM_SMMU_V2, CAVIUM_SMMUV2, "cavium-smmuv2"); I thought about this but underscore names are not typical. Adding some strings as names looks straighforward to me. -Robert > > So that this change will not be required?