From: Andrew Morton <akpm@linux-foundation.org>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: linux-fbdev-devel@lists.sourceforge.net,
LKML <linux-kernel@vger.kernel.org>,
Antonino Daplas <adaplas@gmail.com>
Subject: Re: [PATCH] fbcon: replace mono_col macro with static inline
Date: Mon, 25 Feb 2008 10:50:20 -0800 [thread overview]
Message-ID: <20080225105020.131f3df9.akpm@linux-foundation.org> (raw)
In-Reply-To: <1203963237.5582.4.camel@brick>
On Mon, 25 Feb 2008 10:13:57 -0800 Harvey Harrison <harvey.harrison@gmail.com> wrote:
> Use __u32 for max_len to match the declaration of length in the
> struct fb_bitfield.
>
> Suppresses sparse shadowed variable warnings from the nested max()
> macros:
> drivers/video/console/fbcon.h:130:8: warning: symbol '_x' shadows an earlier one
> drivers/video/console/fbcon.h:130:8: originally declared here
> drivers/video/console/fbcon.h:130:8: warning: symbol '_x' shadows an earlier one
> drivers/video/console/fbcon.h:130:8: originally declared here
> drivers/video/console/fbcon.h:130:8: warning: symbol '_y' shadows an earlier one
> drivers/video/console/fbcon.h:130:8: originally declared here
>
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
> drivers/video/console/fbcon.h | 12 ++++++++----
> 1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
> index 3706307..51a6bf4 100644
> --- a/drivers/video/console/fbcon.h
> +++ b/drivers/video/console/fbcon.h
> @@ -104,10 +104,14 @@ struct fbcon_ops {
> #define attr_blink(s) \
> ((s) & 0x8000)
>
> -#define mono_col(info) \
> - (~(0xfff << (max((info)->var.green.length, \
> - max((info)->var.red.length, \
> - (info)->var.blue.length)))) & 0xff)
> +
> +static inline int mono_col(struct fb_info *info)
> +{
> + __u32 max_len;
> + max_len = max(info->var.green.length, info->var.red.length);
> + max_len = max(info->var.blue.length, max_len);
> + return ~(0xfff << (max_len & 0xff));
> +}
>
> static inline int attr_col_ec(int shift, struct vc_data *vc,
> struct fb_info *info, int is_fg)
Thanks, but please do try to copy a suitable mailing list on the patches.
Particularly fbdev - Tony has been out of contact for a while, but there
are other fbdev developers who can help us to review code, as long as we
tell them about it.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Antonino Daplas <adaplas@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-fbdev-devel@lists.sourceforge.net
Subject: Re: [PATCH] fbcon: replace mono_col macro with static inline
Date: Mon, 25 Feb 2008 10:50:20 -0800 [thread overview]
Message-ID: <20080225105020.131f3df9.akpm@linux-foundation.org> (raw)
In-Reply-To: <1203963237.5582.4.camel@brick>
On Mon, 25 Feb 2008 10:13:57 -0800 Harvey Harrison <harvey.harrison@gmail.com> wrote:
> Use __u32 for max_len to match the declaration of length in the
> struct fb_bitfield.
>
> Suppresses sparse shadowed variable warnings from the nested max()
> macros:
> drivers/video/console/fbcon.h:130:8: warning: symbol '_x' shadows an earlier one
> drivers/video/console/fbcon.h:130:8: originally declared here
> drivers/video/console/fbcon.h:130:8: warning: symbol '_x' shadows an earlier one
> drivers/video/console/fbcon.h:130:8: originally declared here
> drivers/video/console/fbcon.h:130:8: warning: symbol '_y' shadows an earlier one
> drivers/video/console/fbcon.h:130:8: originally declared here
>
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
> drivers/video/console/fbcon.h | 12 ++++++++----
> 1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
> index 3706307..51a6bf4 100644
> --- a/drivers/video/console/fbcon.h
> +++ b/drivers/video/console/fbcon.h
> @@ -104,10 +104,14 @@ struct fbcon_ops {
> #define attr_blink(s) \
> ((s) & 0x8000)
>
> -#define mono_col(info) \
> - (~(0xfff << (max((info)->var.green.length, \
> - max((info)->var.red.length, \
> - (info)->var.blue.length)))) & 0xff)
> +
> +static inline int mono_col(struct fb_info *info)
> +{
> + __u32 max_len;
> + max_len = max(info->var.green.length, info->var.red.length);
> + max_len = max(info->var.blue.length, max_len);
> + return ~(0xfff << (max_len & 0xff));
> +}
>
> static inline int attr_col_ec(int shift, struct vc_data *vc,
> struct fb_info *info, int is_fg)
Thanks, but please do try to copy a suitable mailing list on the patches.
Particularly fbdev - Tony has been out of contact for a while, but there
are other fbdev developers who can help us to review code, as long as we
tell them about it.
next prev parent reply other threads:[~2008-02-25 18:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-25 18:13 [PATCH] fbcon: replace mono_col macro with static inline Harvey Harrison
2008-02-25 18:50 ` Andrew Morton [this message]
2008-02-25 18:50 ` Andrew Morton
2008-02-26 8:18 ` Geert Uytterhoeven
2008-02-26 8:18 ` Geert Uytterhoeven
2008-02-26 20:51 ` Harvey Harrison
2008-02-26 21:36 ` Geert Uytterhoeven
2008-02-26 21:36 ` [Linux-fbdev-devel] " Geert Uytterhoeven
2008-02-26 21:50 ` Harvey Harrison
2008-02-26 21:50 ` [Linux-fbdev-devel] " Harvey Harrison
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=20080225105020.131f3df9.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=adaplas@gmail.com \
--cc=harvey.harrison@gmail.com \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.