public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Nikita Kiryanov <nikita@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 02/13] lcd: split configuration_get_cmap
Date: Sun, 01 Feb 2015 19:02:52 +0200	[thread overview]
Message-ID: <54CE5C3C.6000209@compulab.co.il> (raw)
In-Reply-To: <CAPnjgZ1Em3=SLL4wCR1WiqJyWsfPnaU79PG=d5RTzVap00QgYg@mail.gmail.com>

Hi Simon,

On 01/31/2015 02:24 AM, Simon Glass wrote:
> Hi Nikita,
>
> On 29 January 2015 at 04:21, Nikita Kiryanov <nikita@compulab.co.il> wrote:
>> configuration_get_cmap() is multiple platform specific functions stuffed into
>> one function. Split it into multiple versions, and move each version to the
>> appropriate driver to reduce the #ifdef complexity.
>>
>> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
>> Cc: Bo Shen <voice.shen@atmel.com>
>> Cc: Simon Glass <sjg@chromium.org>
>> Cc: Anatolij Gustschin <agust@denx.de>
>> ---
>>   common/lcd.c                 | 19 -------------------
>>   drivers/video/atmel_hlcdfb.c | 13 +++++++++++++
>>   drivers/video/atmel_lcdfb.c  |  5 +++++
>>   drivers/video/exynos_fb.c    |  9 +++++++++
>>   drivers/video/mpc8xx_lcd.c   |  7 +++++++
>>   drivers/video/pxa_lcd.c      |  6 ++++++
>>   include/lcd.h                |  9 +++++++++
>>   7 files changed, 49 insertions(+), 19 deletions(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> See suggestion below.
>
> [snip]
>> diff --git a/include/lcd.h b/include/lcd.h
>> index fbba6a2..838f645 100644
>> --- a/include/lcd.h
>> +++ b/include/lcd.h
>> @@ -42,13 +42,17 @@ void lcd_set_flush_dcache(int flush);
>>
>>   #if defined CONFIG_MPC823
>>   #include <mpc823_lcd.h>
>> +ushort *configuration_get_cmap(void);
>>   #elif defined(CONFIG_CPU_PXA25X) || defined(CONFIG_CPU_PXA27X) || \
>>          defined CONFIG_CPU_MONAHANS
>>   #include <pxa_lcd.h>
>> +ushort *configuration_get_cmap(void);
>>   #elif defined(CONFIG_ATMEL_LCD) || defined(CONFIG_ATMEL_HLCD)
>>   #include <atmel_lcd.h>
>> +ushort *configuration_get_cmap(void);
>>   #elif defined(CONFIG_EXYNOS_FB)
>>   #include <exynos_lcd.h>
>> +ushort *configuration_get_cmap(void);
>>   #else
>>   typedef struct vidinfo {
>>          ushort  vl_col;         /* Number of columns (i.e. 160) */
>> @@ -60,6 +64,11 @@ typedef struct vidinfo {
>>
>>          void    *priv;          /* Pointer to driver-specific data */
>>   } vidinfo_t;
>> +
>> +static inline ushort *configuration_get_cmap(void)
>> +{
>> +       return panel_info.cmap;
>> +}
>>   #endif
>
> I'd argue for dropping the inline version and just having the same
> prototype in each case.

Are you suggesting something along the lines of:

static ushort *configuration_get_cmap(void)
{
        return panel_info.cmap;
}
#endif

ushort *configuration_get_cmap(void);

?

This is something I considered while preparing this, but I was under the impression
that this isn't well defined by the standard. However, I actually have confirmation
now that it is in fact defined behavior[1], so I will submit a V2 for this (even though
I expect all of the above to disappear from lcd.h in the next refactor series).

[1] http://stackoverflow.com/questions/28264874/non-static-function-prototype-follows-static-function-declaration

>
> Regards,
> Simon
>

-- 
Regards,
Nikita Kiryanov

  reply	other threads:[~2015-02-01 17:02 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 11:21 [U-Boot] [PATCH 00/13] common lcd refactor Nikita Kiryanov
2015-01-29 11:21 ` [U-Boot] [PATCH 01/13] lcd: move platform specific structs to their own headers Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 02/13] lcd: split configuration_get_cmap Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-02-01 17:02     ` Nikita Kiryanov [this message]
2015-02-01 17:14       ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 03/13] lcd: atmel: move atmel specific fb_put_word to atmel_lcdfb Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 04/13] lcd: mpc8xx: move mpc823 specific fb_put_byte to mpc8xx_lcd.c Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 05/13] lcd: atmel: introduce lcd_logo_set_cmap Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 06/13] lcd: mpc823: move mpc823 specific lcd_logo_set_cmap code to mpc8xx_lcd.c Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 07/13] lcd: logo: move generic cmap setting to lcd_logo_set_cmap() Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 08/13] lcd: introduce lcd_set_cmap Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 09/13] lcd: remove unused includes Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 10/13] lcd: various cleanups Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 11/13] lcd: rename bitmap_plot to better represent its functionality Nikita Kiryanov
2015-01-31  0:25   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 12/13] lcd: dt: extract simplefb support Nikita Kiryanov
2015-01-29 17:14   ` Stephen Warren
2015-02-01 13:58     ` Nikita Kiryanov
2015-01-31  0:25   ` Simon Glass
2015-02-01 13:56     ` Nikita Kiryanov
2015-01-29 11:21 ` [U-Boot] [PATCH 13/13] lcd: split splash code into its own function Nikita Kiryanov
2015-01-31  0:25   ` Simon Glass
2015-02-01 13:59     ` Nikita Kiryanov
2015-02-01 16:25       ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54CE5C3C.6000209@compulab.co.il \
    --to=nikita@compulab.co.il \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox