From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Helge Deller <deller@gmx.de>
Cc: Michael Schmitz <schmitzmic@gmail.com>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-m68k@vger.kernel.org,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH 2/3] video: fbdev: atari: Convert to standard round_up() helper
Date: Tue, 15 Feb 2022 12:21:25 +0100 [thread overview]
Message-ID: <20220215112126.2633383-3-geert@linux-m68k.org> (raw)
In-Reply-To: <20220215112126.2633383-1-geert@linux-m68k.org>
Remove the custom macro up(), and convert the code to use the standard
round_up() helper instead.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/video/fbdev/atafb.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c
index a9f25cab4a1e6737..b9d6aaaeae43f2f1 100644
--- a/drivers/video/fbdev/atafb.c
+++ b/drivers/video/fbdev/atafb.c
@@ -76,8 +76,6 @@
#define SWITCH_SND7 0x80
#define SWITCH_NONE 0x00
-#define up(x, r) (((x) + (r) - 1) & ~((r)-1))
-
static int default_par; /* default resolution (0=none) */
@@ -1649,12 +1647,12 @@ static int falcon_pan_display(struct fb_var_screeninfo *var,
int bpp = info->var.bits_per_pixel;
if (bpp == 1)
- var->xoffset = up(var->xoffset, 32);
+ var->xoffset = round_up(var->xoffset, 32);
if (bpp != 16)
par->hw.falcon.xoffset = var->xoffset & 15;
else {
par->hw.falcon.xoffset = 0;
- var->xoffset = up(var->xoffset, 2);
+ var->xoffset = round_up(var->xoffset, 2);
}
par->hw.falcon.line_offset = bpp *
(info->var.xres_virtual - info->var.xres) / 16;
@@ -2268,7 +2266,7 @@ static int pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
if (!fbhw->set_screen_base ||
(!ATARIHW_PRESENT(EXTD_SHIFTER) && var->xoffset))
return -EINVAL;
- var->xoffset = up(var->xoffset, 16);
+ var->xoffset = round_up(var->xoffset, 16);
par->screen_base = screen_base +
(var->yoffset * info->var.xres_virtual + var->xoffset)
* info->var.bits_per_pixel / 8;
--
2.25.1
next prev parent reply other threads:[~2022-02-15 11:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-15 11:21 [PATCH 0/3] video: fbdev: atari: Miscellaneous fixes Geert Uytterhoeven
2022-02-15 11:21 ` [PATCH 1/3] video: fbdev: atari: Fix TT High video mode Geert Uytterhoeven
2022-02-15 11:21 ` Geert Uytterhoeven [this message]
2022-02-15 11:21 ` [PATCH 3/3] video: fbdev: atari: Remove unused atafb_setcolreg() Geert Uytterhoeven
2022-02-15 20:36 ` [PATCH 0/3] video: fbdev: atari: Miscellaneous fixes Helge Deller
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=20220215112126.2633383-3-geert@linux-m68k.org \
--to=geert@linux-m68k.org \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--cc=schmitzmic@gmail.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