Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754302AbdLHPjY (ORCPT ); Fri, 8 Dec 2017 10:39:24 -0500 Received: from mail-db5eur01on0138.outbound.protection.outlook.com ([104.47.2.138]:46699 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754031AbdLHPjQ (ORCPT ); Fri, 8 Dec 2017 10:39:16 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Subject: Re: [PATCH v1 1/2] eeprom: at24: convert magic numbers to structs. To: Sven Van Asbroeck , Bartosz Golaszewski Cc: Sven Van Asbroeck , Wolfram Sang , nsekhar@ti.com, Sakari Ailus , Javier Martinez Canillas , Divagar Mohandass , devicetree@vger.kernel.org, Linux Kernel Mailing List , linux-i2c References: <1512576272-25563-1-git-send-email-svendev@arcx.com> <1512576272-25563-2-git-send-email-svendev@arcx.com> From: Peter Rosin Organization: Axentia Technologies AB Message-ID: Date: Fri, 8 Dec 2017 16:39:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [85.226.244.23] X-ClientProxiedBy: AM3PR07CA0113.eurprd07.prod.outlook.com (2603:10a6:207:7::23) To DB6PR0202MB2551.eurprd02.prod.outlook.com (2603:10a6:4:1b::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fb2dddcb-68be-4a9a-bc5d-08d53e51d4e1 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4603075)(4627115)(201702281549075)(2017052603307);SRVR:DB6PR0202MB2551; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0202MB2551;3:PPDP0reUpArRqUhY3CQCW98DIn5M7KqFGPBs273c6nylwxLGz6+kSgXXMEGr8Rhr3EFZoU9qPB8Jtcgk3KltDnoK6uB/ck/uiG9ME1MkVYro6Y8Qyb50O/pnL1NR4mN/ArycAmvyY8BB/m00CC1Z5C9ykkutqstYpcOH8mntRHQzkprtf6vqBdLHXAWVpFXAS2+aHPyTI/iTejB6d8rKea+2Fv0m0fiq3rnIqEWXUUsWkECoQaaMRxdUJU8dxa/A;25:9ErxR2U3YexGFKBovdFIQLN0vxNKstnOf3djLpKqfboDXz3+2sYWRv5732LmaKOP6F/l+S6Sa+Hwv0xHLD/AoAN2TEHwxJDRClUrDxgEbGPxZq9/C+8eX69LsE9ydCIUNbTjevs0foErzg+WIpKPYxfK50rWrHhhVVTQzs2EbUeiVCuyXdxmzQm+rbt4IRaY16rBc2VFs0++jxzJWE83pU4KHHNOEZqZWuBJKFygd8vQUPwzwo26aw8PMRZi95wmBR6OhO2AtPZzUNDjXGo8Cem58yTXahAAgov8D0VodHYnzIuRAohkCSWzTDBYx0gDZJBDByzvHE2nIRqSTeRP3g==;31:uSKjbB51fgDt7BCnhyqE32te8pJdd/yyfnIzJFzgcJXXCyQd1idyviH8YltmuBotw7IBertkW+Mc54HqAmN8+m46RChjEKM8dkrumSS2NlYrl1zoB0lITrffxozx0moak/+WDdOcyp3qpfllBllSW0wF+At8KywzqGznUp4P1ZKP+kmaE480tPAFN+KCjm+UiyQg4856Qj4l9RKA/3uQ6vfZuKFtP6xp03ziIn/L3CY= X-MS-TrafficTypeDiagnostic: DB6PR0202MB2551: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231022)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(20161123558100)(2016111802025)(6072148)(6043046)(201708071742011);SRVR:DB6PR0202MB2551;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DB6PR0202MB2551; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0202MB2551;4:ENOgKRHUJiKLOFq1q3aUPkHfkcH48KdPkQTa2r7V4B8uxe9ouLg+6XX3874xJmFAKiEVz7v3TY8C8EvA5p7Gk58vLjvGs/BR6cuc//kVFEGX6X8Uwmo5z61qOj88BLM+x3CBcXDhMVikGi5OQpnDVaaqBtzM7exsgTlw9iM0Vc/Kk6NvmxW7FfB5kUz99AnXD7E+sTZa6q65hlbqMdIR3qoVXi9U0jTCsTTmxOuT+wewWfb0v0fBvE9v+FrBqtY6XGFiBOVVVjJ/ivqxskVSgQ== X-Forefront-PRVS: 0515208626 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(366004)(376002)(346002)(39830400002)(189003)(199004)(377424004)(24454002)(2950100002)(68736007)(52146003)(52116002)(23676004)(36916002)(36756003)(229853002)(77096006)(31686004)(83506002)(6486002)(3846002)(74482002)(81166006)(81156014)(86362001)(6116002)(39060400002)(2486003)(8676002)(6246003)(53936002)(305945005)(2906002)(31696002)(25786009)(7736002)(230700001)(3260700006)(105586002)(58126008)(54906003)(478600001)(316002)(110136005)(16576012)(16526018)(106356001)(66066001)(4326008)(5660300001)(64126003)(47776003)(8936002)(93886005)(6666003)(65826007)(65956001)(117156002)(7416002)(65806001)(97736004)(53546010)(33646002)(50466002)(76176011)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DB6PR0202MB2551;H:[192.168.13.3];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjZQUjAyMDJNQjI1NTE7MjM6bjJJUGRkSmU1TlRaT3VNNHl5VE5hdUR2?= =?utf-8?B?QlBnbUtTd3hnWDR0cDBURk9VSGZ2VWVrZFJTaVdWdjdKdlBCTDJNVmhxQlMr?= =?utf-8?B?Mit3ZjY5d0VqNGYrdytzT1BCdVZPOVJo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vRAJw3aC1kaCDrAK8RDI5Bg+5Z/rz1DbRyabVHq+6nZIFfeA SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2017 15:39:12.1067 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fb2dddcb-68be-4a9a-bc5d-08d53e51d4e1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0202MB2551 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 701 Lines: 25 On 2017-12-08 16:28, Sven Van Asbroeck wrote: > Bartosz wrote: >> Just make it accept two parameters: the string and the data object >> name. For example: >> >> AT24_OF_DEVICE_ID("atmel,24c01", 24c01); >> > > I don't want to do too much bikeshedding, > but one last comment. > > Is it a good idea to have duplicated information? > Do you think the risk of a typo mismatch is acceptable? E.g. > AT24_OF_DEVICE_ID("atmel,24c01", 24c02); > > At least the original syntax is not susceptible to this problem, > but of course as you say, it hides the of_ compatible string: > AT24_OF_DEVICE_ID(atmel, 24c01); > /* hides 'atmel,24c01' */ It's nice to be able to grep for compatible strings. $.02 /peda