Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1479907

Re: [PATCH v3 3/3] intel-mid: Move boundry check to the start of init code

From Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 3/3] intel-mid: Move boundry check to the start of init code
Date 2016-09-09 13:40 +0200
Message-ID <sfsk1-2dK-9@gated-at.bofh.it> (permalink)
References <sezxf-1jF-1@gated-at.bofh.it> <sfjA5-5sJ-1@gated-at.bofh.it>
Organization Intel Finland Oy

Show all headers | View raw


On Thu, 2016-09-08 at 19:07 -0700, Kuppuswamy Sathyanarayanan wrote:
> Moved the instance boundary check to the start of the pcal9555a
> platform init code. This will prevent unnecessary initialization
> on instance boundary error.

I don't see how it makes any better.

I would drop this patch.

> 
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@
> linux.intel.com>
> ---
>  arch/x86/platform/intel-mid/device_libs/platform_pcal9555a.c | 12
> ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/x86/platform/intel-
> mid/device_libs/platform_pcal9555a.c b/arch/x86/platform/intel-
> mid/device_libs/platform_pcal9555a.c
> index cde764e..4e5dd95 100644
> --- a/arch/x86/platform/intel-mid/device_libs/platform_pcal9555a.c
> +++ b/arch/x86/platform/intel-mid/device_libs/platform_pcal9555a.c
> @@ -34,6 +34,12 @@ static void __init *pcal9555a_platform_data(void
> *info)
>  	char intr_pin_name[SFI_NAME_LEN + 1];
>  	int gpio_base, intr;
>  
> +	if (nr >= PCAL9555A_NUM) {
> +		pr_err("%s: Too many instances, only %d supported\n",
> __func__,
> +		       PCAL9555A_NUM);
> +		return ERR_PTR(-ENOMEM);
> +	}
> +
>  	snprintf(base_pin_name, sizeof(base_pin_name), "%s_base",
> type);
>  	snprintf(intr_pin_name, sizeof(intr_pin_name), "%s_int",
> type);
>  
> @@ -47,12 +53,6 @@ static void __init *pcal9555a_platform_data(void
> *info)
>  		return NULL;
>  	}
>  
> -	if (nr >= PCAL9555A_NUM) {
> -		pr_err("%s: Too many instances, only %d supported\n",
> __func__,
> -		       PCAL9555A_NUM);
> -		return ERR_PTR(-ENOMEM);
> -	}
> -
>  	pcal9555a = &pcal9555a_pdata[nr++];
>  	pcal9555a->gpio_base = gpio_base;
>  

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/1] intel-mid: Fix sfi get_platform_data() return value issues Kuppuswamy Sathyanarayanan          <sathyanarayanan.kuppuswamy@linux.intel.com> - 2016-09-07 03:10 +0200
  Re: [PATCH 1/1] intel-mid: Fix sfi get_platform_data() return value  issues Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-09-07 14:20 +0200
    Re: [PATCH 1/1] intel-mid: Fix sfi get_platform_data() return value  issues sathyanarayanan kuppuswamy          <sathyanarayanan.kuppuswamy@linux.intel.com> - 2016-09-08 02:10 +0200
      Re: [PATCH 1/1] intel-mid: Fix sfi get_platform_data() return value  issues Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-09-08 11:50 +0200
  [PATCH v2 1/1] intel-mid: Fix sfi get_platform_data() return value issues Kuppuswamy Sathyanarayanan          <sathyanarayanan.kuppuswamy@linux.intel.com> - 2016-09-08 02:10 +0200
    Re: [PATCH v2 1/1] intel-mid: Fix sfi get_platform_data() return  value issues Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-09-08 15:00 +0200
      Re: [PATCH v2 1/1] intel-mid: Fix sfi get_platform_data() return  value issues sathyanarayanan kuppuswamy          <sathyanarayanan.kuppuswamy@linux.intel.com> - 2016-09-09 00:50 +0200
        Re: [PATCH v2 1/1] intel-mid: Fix sfi get_platform_data() return  value issues Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-09-09 13:30 +0200
  [PATCH v3 3/3] intel-mid: Move boundry check to the start of init code Kuppuswamy Sathyanarayanan          <sathyanarayanan.kuppuswamy@linux.intel.com> - 2016-09-09 04:20 +0200
    Re: [PATCH v3 3/3] intel-mid: Move boundry check to the start of  init code Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-09-09 13:40 +0200
  [PATCH v3 1/3] intel-mid: Fix sfi get_platform_data() return value issues Kuppuswamy Sathyanarayanan          <sathyanarayanan.kuppuswamy@linux.intel.com> - 2016-09-09 04:20 +0200
  [PATCH v3 2/3] intel-mid: Add valid error messages on init failure Kuppuswamy Sathyanarayanan          <sathyanarayanan.kuppuswamy@linux.intel.com> - 2016-09-09 04:20 +0200
    Re: [PATCH v3 2/3] intel-mid: Add valid error messages on init  failure Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-09-09 13:30 +0200

csiph-web