From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934017AbcJYQWZ (ORCPT ); Tue, 25 Oct 2016 12:22:25 -0400 Received: from mail-qk0-f170.google.com ([209.85.220.170]:38871 "EHLO mail-qk0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756592AbcJYQWX (ORCPT ); Tue, 25 Oct 2016 12:22:23 -0400 MIME-Version: 1.0 In-Reply-To: <21019d11-3b01-3e0e-60bc-c4873cf20237@lechnology.com> References: <20161024164634.4330-1-ahaslam@baylibre.com> <20161024164634.4330-12-ahaslam@baylibre.com> <403743d8-dff2-3389-105b-1082b674b0b8@lechnology.com> <21019d11-3b01-3e0e-60bc-c4873cf20237@lechnology.com> From: Axel Haslam Date: Tue, 25 Oct 2016 18:21:42 +0200 Message-ID: Subject: Re: [PATCH/RFT v2 11/17] USB: OHCI: make ohci-da8xx a separate driver To: David Lechner Cc: Greg KH , Johan Hovold , robh+dt@kernel.org, Sekhar Nori , Alan Stern , Kevin Hilman , Sergei Shtylyov , manjunath.goudar@linaro.org, Mark Brown , Alexandre Bailon , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 25, 2016 at 6:12 PM, David Lechner wrote: > On 10/25/2016 02:39 AM, Axel Haslam wrote: >> >> On Tue, Oct 25, 2016 at 2:38 AM, David Lechner >> wrote: >>> >>> On 10/24/2016 11:46 AM, ahaslam@baylibre.com wrote: >>>> >>>> >>>> -#ifndef CONFIG_ARCH_DAVINCI_DA8XX >>>> -#error "This file is DA8xx bus glue. Define >>>> CONFIG_ARCH_DAVINCI_DA8XX." >>>> -#endif >>>> +#include "ohci.h" >>>> + >>>> +#define DRIVER_DESC "OHCI DA8XX driver" >>>> + >>>> +static const char hcd_name[] = "ohci-da8xx"; >>> >>> >>> >>> why static const char instead of #define? This is only used one time in a >>> pr_info, so it seems kind of pointless anyway. >> >> >> Other drivers are using static const for the same variable. >> i think static const is preferred over #define because #define doet give a >> type. >> If you dont mind ill keep it static const. >> > > If this string was used in this file more than one place, I would agree with > you, but currently it is only used as the argument of a pr_info(). The > string "ohci-da8xx" could just be included in the fmt string instead of > using "%s". I think the purpose was to use it in the .name of the platform_driver structure, too. only that not everybody is doing that, i looked at some bad examples :( would you agree to keep it if we use it in .name too? -Axel > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Axel Haslam Subject: Re: [PATCH/RFT v2 11/17] USB: OHCI: make ohci-da8xx a separate driver Date: Tue, 25 Oct 2016 18:21:42 +0200 Message-ID: References: <20161024164634.4330-1-ahaslam@baylibre.com> <20161024164634.4330-12-ahaslam@baylibre.com> <403743d8-dff2-3389-105b-1082b674b0b8@lechnology.com> <21019d11-3b01-3e0e-60bc-c4873cf20237@lechnology.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <21019d11-3b01-3e0e-60bc-c4873cf20237-nq/r/kbU++upp/zk7JDF2g@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: David Lechner Cc: Greg KH , Johan Hovold , robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Sekhar Nori , Alan Stern , Kevin Hilman , Sergei Shtylyov , manjunath.goudar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, Mark Brown , Alexandre Bailon , linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On Tue, Oct 25, 2016 at 6:12 PM, David Lechner wrote: > On 10/25/2016 02:39 AM, Axel Haslam wrote: >> >> On Tue, Oct 25, 2016 at 2:38 AM, David Lechner >> wrote: >>> >>> On 10/24/2016 11:46 AM, ahaslam-rdvid1DuHRBWk0Htik3J/w@public.gmane.org wrote: >>>> >>>> >>>> -#ifndef CONFIG_ARCH_DAVINCI_DA8XX >>>> -#error "This file is DA8xx bus glue. Define >>>> CONFIG_ARCH_DAVINCI_DA8XX." >>>> -#endif >>>> +#include "ohci.h" >>>> + >>>> +#define DRIVER_DESC "OHCI DA8XX driver" >>>> + >>>> +static const char hcd_name[] = "ohci-da8xx"; >>> >>> >>> >>> why static const char instead of #define? This is only used one time in a >>> pr_info, so it seems kind of pointless anyway. >> >> >> Other drivers are using static const for the same variable. >> i think static const is preferred over #define because #define doet give a >> type. >> If you dont mind ill keep it static const. >> > > If this string was used in this file more than one place, I would agree with > you, but currently it is only used as the argument of a pr_info(). The > string "ohci-da8xx" could just be included in the fmt string instead of > using "%s". I think the purpose was to use it in the .name of the platform_driver structure, too. only that not everybody is doing that, i looked at some bad examples :( would you agree to keep it if we use it in .name too? -Axel > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: ahaslam@baylibre.com (Axel Haslam) Date: Tue, 25 Oct 2016 18:21:42 +0200 Subject: [PATCH/RFT v2 11/17] USB: OHCI: make ohci-da8xx a separate driver In-Reply-To: <21019d11-3b01-3e0e-60bc-c4873cf20237@lechnology.com> References: <20161024164634.4330-1-ahaslam@baylibre.com> <20161024164634.4330-12-ahaslam@baylibre.com> <403743d8-dff2-3389-105b-1082b674b0b8@lechnology.com> <21019d11-3b01-3e0e-60bc-c4873cf20237@lechnology.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, Oct 25, 2016 at 6:12 PM, David Lechner wrote: > On 10/25/2016 02:39 AM, Axel Haslam wrote: >> >> On Tue, Oct 25, 2016 at 2:38 AM, David Lechner >> wrote: >>> >>> On 10/24/2016 11:46 AM, ahaslam at baylibre.com wrote: >>>> >>>> >>>> -#ifndef CONFIG_ARCH_DAVINCI_DA8XX >>>> -#error "This file is DA8xx bus glue. Define >>>> CONFIG_ARCH_DAVINCI_DA8XX." >>>> -#endif >>>> +#include "ohci.h" >>>> + >>>> +#define DRIVER_DESC "OHCI DA8XX driver" >>>> + >>>> +static const char hcd_name[] = "ohci-da8xx"; >>> >>> >>> >>> why static const char instead of #define? This is only used one time in a >>> pr_info, so it seems kind of pointless anyway. >> >> >> Other drivers are using static const for the same variable. >> i think static const is preferred over #define because #define doet give a >> type. >> If you dont mind ill keep it static const. >> > > If this string was used in this file more than one place, I would agree with > you, but currently it is only used as the argument of a pr_info(). The > string "ohci-da8xx" could just be included in the fmt string instead of > using "%s". I think the purpose was to use it in the .name of the platform_driver structure, too. only that not everybody is doing that, i looked at some bad examples :( would you agree to keep it if we use it in .name too? -Axel >