Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754159AbdLHPck (ORCPT ); Fri, 8 Dec 2017 10:32:40 -0500 Received: from mail-oi0-f52.google.com ([209.85.218.52]:43450 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753921AbdLHPce (ORCPT ); Fri, 8 Dec 2017 10:32:34 -0500 X-Google-Smtp-Source: AGs4zMYVN3KZZnsplCK2miKKVeetdA3dPNAllimDcfLMYSPXK/IWDG4NnOlT2xCoxQMOB6etjTUEiAlhxPQIwbvHA/Q= MIME-Version: 1.0 In-Reply-To: References: <1512576272-25563-1-git-send-email-svendev@arcx.com> <1512576272-25563-2-git-send-email-svendev@arcx.com> From: Bartosz Golaszewski Date: Fri, 8 Dec 2017 16:32:33 +0100 Message-ID: Subject: Re: [PATCH v1 1/2] eeprom: at24: convert magic numbers to structs. To: Sven Van Asbroeck 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 792 Lines: 29 2017-12-08 16:25 GMT+01:00 Sven Van Asbroeck : > 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", 24c0 > 2 > ); > 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' */ > > Pros and cons. Pick one. Nah, there aren't like two thousand compatible chips so that a mistake would go unnoticed. Bartosz