diff mbox

[1/1,linux-next] video: fbdev: matrox: use swap() in matroxfb_decode_var()

Message ID 1431970264-16195-1-git-send-email-fabf@skynet.be (mailing list archive)
State New, archived
Headers show

Commit Message

Fabian Frederick May 18, 2015, 5:31 p.m. UTC
Use kernel.h macro definition.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/video/fbdev/matrox/matroxfb_base.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Tomi Valkeinen May 26, 2015, 8:32 a.m. UTC | #1
On 18/05/15 20:31, Fabian Frederick wrote:
> Use kernel.h macro definition.
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  drivers/video/fbdev/matrox/matroxfb_base.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/video/fbdev/matrox/matroxfb_base.c b/drivers/video/fbdev/matrox/matroxfb_base.c
> index 62539ca..2ba4e54 100644
> --- a/drivers/video/fbdev/matrox/matroxfb_base.c
> +++ b/drivers/video/fbdev/matrox/matroxfb_base.c
> @@ -591,12 +591,8 @@ static int matroxfb_decode_var(const struct matrox_fb_info *minfo,
>  			unsigned int max_yres;
>  
>  			while (m1) {
> -				int t;
> -
>  				while (m2 >= m1) m2 -= m1;
> -				t = m1;
> -				m1 = m2;
> -				m2 = t;
> +				swap(m1, m2);
>  			}
>  			m2 = linelen * PAGE_SIZE / m2;
>  			*ydstorg = m2 = 0x400000 % m2;
> 

Thanks, I've queued this and the two other swap() patches for 4.2.

 Tomi
diff mbox

Patch

diff --git a/drivers/video/fbdev/matrox/matroxfb_base.c b/drivers/video/fbdev/matrox/matroxfb_base.c
index 62539ca..2ba4e54 100644
--- a/drivers/video/fbdev/matrox/matroxfb_base.c
+++ b/drivers/video/fbdev/matrox/matroxfb_base.c
@@ -591,12 +591,8 @@  static int matroxfb_decode_var(const struct matrox_fb_info *minfo,
 			unsigned int max_yres;
 
 			while (m1) {
-				int t;
-
 				while (m2 >= m1) m2 -= m1;
-				t = m1;
-				m1 = m2;
-				m2 = t;
+				swap(m1, m2);
 			}
 			m2 = linelen * PAGE_SIZE / m2;
 			*ydstorg = m2 = 0x400000 % m2;