From: Greg KH <gregkh@linuxfoundation.org>
To: Shiva Kerdel <shiva@exdev.nl>
Cc: thomas.petazzoni@free-electrons.com, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: fbtft: fbtft-core.c: EXPORT_SYMBOL should immediately follow its function
Date: Sat, 29 Apr 2017 07:26:33 +0200 [thread overview]
Message-ID: <20170429052633.GA11251@kroah.com> (raw)
In-Reply-To: <20170428230734.14533-1-shiva@exdev.nl>
On Sat, Apr 29, 2017 at 01:07:34AM +0200, Shiva Kerdel wrote:
> This patch fixes the following checkpatch.pl warning
> - EXPORT_SYMBOL(foo); should immediately follow its function/variable
>
> Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
> ---
> drivers/staging/fbtft/fbtft-core.c | 25 +++++++++++++++----------
> 1 file changed, 15 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
> index b742ee7..b004a4d 100644
> --- a/drivers/staging/fbtft/fbtft-core.c
> +++ b/drivers/staging/fbtft/fbtft-core.c
> @@ -275,23 +275,31 @@ static int fbtft_backlight_get_brightness(struct backlight_device *bd)
> return bd->props.brightness;
> }
>
> +static const struct backlight_ops fbtft_bl_ops = {
> + .get_brightness = fbtft_backlight_get_brightness,
> + .update_status = fbtft_backlight_update_status,
> +};
> +#endif
> +
> void fbtft_unregister_backlight(struct fbtft_par *par)
> {
> + #ifdef CONFIG_FB_BACKLIGHT
Ick, no, does this really look like good style?
> +
> if (par->info->bl_dev) {
> par->info->bl_dev->props.power = FB_BLANK_POWERDOWN;
> backlight_update_status(par->info->bl_dev);
> backlight_device_unregister(par->info->bl_dev);
> par->info->bl_dev = NULL;
> }
> -}
>
> -static const struct backlight_ops fbtft_bl_ops = {
> - .get_brightness = fbtft_backlight_get_brightness,
> - .update_status = fbtft_backlight_update_status,
> -};
> + #endif
> +}
> +EXPORT_SYMBOL(fbtft_unregister_backlight);
>
> void fbtft_register_backlight(struct fbtft_par *par)
> {
> + #ifdef CONFIG_FB_BACKLIGHT
> +
> struct backlight_device *bd;
> struct backlight_properties bl_props = { 0, };
>
> @@ -320,13 +328,10 @@ void fbtft_register_backlight(struct fbtft_par *par)
>
> if (!par->fbtftops.unregister_backlight)
> par->fbtftops.unregister_backlight = fbtft_unregister_backlight;
> +
> + #endif
> }
> -#else
> -void fbtft_register_backlight(struct fbtft_par *par) { };
> -void fbtft_unregister_backlight(struct fbtft_par *par) { };
> -#endif
> EXPORT_SYMBOL(fbtft_register_backlight);
> -EXPORT_SYMBOL(fbtft_unregister_backlight);
The original code here is fine, please leave it as-is.
thanks,
greg k-h
prev parent reply other threads:[~2017-04-29 5:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-28 23:07 Shiva Kerdel
2017-04-29 5:26 ` Greg KH [this message]
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=20170429052633.GA11251@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=devel@driverdev.osuosl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shiva@exdev.nl \
--cc=thomas.petazzoni@free-electrons.com \
/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
Powered by JetHome