From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752391AbcG2Kxw (ORCPT ); Fri, 29 Jul 2016 06:53:52 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35225 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750948AbcG2Kxs (ORCPT ); Fri, 29 Jul 2016 06:53:48 -0400 Subject: Re: [PATCH 3/3] mdacon: replace MDA_ADDR macro by inline function To: Joe Perches , tomi.valkeinen@ti.com References: <20160725152440.6734-1-jslaby@suse.cz> <20160725152440.6734-3-jslaby@suse.cz> <1469462669.1900.181.camel@perches.com> Cc: plagnioj@jcrosoft.com, linux-fbdev@vger.kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org From: Jiri Slaby Message-ID: Date: Fri, 29 Jul 2016 12:53:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <1469462669.1900.181.camel@perches.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/25/2016, 06:04 PM, Joe Perches wrote: > On Mon, 2016-07-25 at 17:24 +0200, Jiri Slaby wrote: >> MDA_ADDR is one of those macros which could be an inline function. So >> convert MDA_ADDR to mda_addr. >> >> Signed-off-by: Jiri Slaby >> --- >> drivers/video/console/mdacon.c | 19 +++++++++++-------- >> 1 file changed, 11 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c >> index 814606bd26d1..24fe55134eb5 100644 >> --- a/drivers/video/console/mdacon.c >> +++ b/drivers/video/console/mdacon.c >> @@ -420,17 +420,20 @@ static void mdacon_invert_region(struct vc_data *c, u16 *p, int count) >> } >> } >> >> -#define MDA_ADDR(x, y) (mda_vram_base + (y)*mda_num_columns + (x)) >> +static inline u16 *mda_addr(unsigned int x, unsigned int y) > > Are you sure about the unsigned? > All of the changed use are taking int Yeah, they are really absolute x and y coordinates. thanks, -- js suse labs From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Slaby Date: Fri, 29 Jul 2016 10:53:44 +0000 Subject: Re: [PATCH 3/3] mdacon: replace MDA_ADDR macro by inline function Message-Id: List-Id: References: <20160725152440.6734-1-jslaby@suse.cz> <20160725152440.6734-3-jslaby@suse.cz> <1469462669.1900.181.camel@perches.com> In-Reply-To: <1469462669.1900.181.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Joe Perches , tomi.valkeinen@ti.com Cc: plagnioj@jcrosoft.com, linux-fbdev@vger.kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org On 07/25/2016, 06:04 PM, Joe Perches wrote: > On Mon, 2016-07-25 at 17:24 +0200, Jiri Slaby wrote: >> MDA_ADDR is one of those macros which could be an inline function. So >> convert MDA_ADDR to mda_addr. >> >> Signed-off-by: Jiri Slaby >> --- >> drivers/video/console/mdacon.c | 19 +++++++++++-------- >> 1 file changed, 11 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c >> index 814606bd26d1..24fe55134eb5 100644 >> --- a/drivers/video/console/mdacon.c >> +++ b/drivers/video/console/mdacon.c >> @@ -420,17 +420,20 @@ static void mdacon_invert_region(struct vc_data *c, u16 *p, int count) >> } >> } >> >> -#define MDA_ADDR(x, y) (mda_vram_base + (y)*mda_num_columns + (x)) >> +static inline u16 *mda_addr(unsigned int x, unsigned int y) > > Are you sure about the unsigned? > All of the changed use are taking int Yeah, they are really absolute x and y coordinates. thanks, -- js suse labs