From: "luca.risolia@studio.unibo.it" <luca.risolia@studio.unibo.it>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
mchehab@infradead.org
Subject: Re: [PATCH] Fix namespace conflict between w9968cf.c on MIPS
Date: Mon, 11 Dec 2006 21:01:26 +0100 [thread overview]
Message-ID: <1165867286.457db9169cf67@posta.studio.unibo.it> (raw)
In-Reply-To: <20061210194144.GA423@linux-mips.org>
Okay, thanks.
Best regards
Luca Risolia
Scrive Ralf Baechle <ralf@linux-mips.org>:
> Both use __SC. Since __* is sort of private namespace I've choosen to
> fix this in the driver. For consistency I decieded to also change
> __UNSC to UNSC.
>
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
>
> diff --git a/drivers/media/video/w9968cf.c b/drivers/media/video/w9968cf.c
> index ddce2fb..9f403af 100644
> --- a/drivers/media/video/w9968cf.c
> +++ b/drivers/media/video/w9968cf.c
> @@ -1827,8 +1827,8 @@ w9968cf_set_window(struct w9968cf_device
> int err = 0;
>
> /* Work around to avoid FP arithmetics */
> - #define __SC(x) ((x) << 10)
> - #define __UNSC(x) ((x) >> 10)
> + #define SC(x) ((x) << 10)
> + #define UNSC(x) ((x) >> 10)
>
> /* Make sure we are using a supported resolution */
> if ((err = w9968cf_adjust_window_size(cam, (u16*)&win.width,
> @@ -1836,15 +1836,15 @@ w9968cf_set_window(struct w9968cf_device
> goto error;
>
> /* Scaling factors */
> - fw = __SC(win.width) / cam->maxwidth;
> - fh = __SC(win.height) / cam->maxheight;
> + fw = SC(win.width) / cam->maxwidth;
> + fh = SC(win.height) / cam->maxheight;
>
> /* Set up the width and height values used by the chip */
> if ((win.width > cam->maxwidth) || (win.height > cam->maxheight)) {
> cam->vpp_flag |= VPP_UPSCALE;
> /* Calculate largest w,h mantaining the same w/h ratio */
> - w = (fw >= fh) ? cam->maxwidth : __SC(win.width)/fh;
> - h = (fw >= fh) ? __SC(win.height)/fw : cam->maxheight;
> + w = (fw >= fh) ? cam->maxwidth : SC(win.width)/fh;
> + h = (fw >= fh) ? SC(win.height)/fw : cam->maxheight;
> if (w < cam->minwidth) /* just in case */
> w = cam->minwidth;
> if (h < cam->minheight) /* just in case */
> @@ -1861,8 +1861,8 @@ w9968cf_set_window(struct w9968cf_device
>
> /* Calculate cropped area manteining the right w/h ratio */
> if (cam->largeview && !(cam->vpp_flag & VPP_UPSCALE)) {
> - cw = (fw >= fh) ? cam->maxwidth : __SC(win.width)/fh;
> - ch = (fw >= fh) ? __SC(win.height)/fw : cam->maxheight;
> + cw = (fw >= fh) ? cam->maxwidth : SC(win.width)/fh;
> + ch = (fw >= fh) ? SC(win.height)/fw : cam->maxheight;
> } else {
> cw = w;
> ch = h;
> @@ -1901,8 +1901,8 @@ w9968cf_set_window(struct w9968cf_device
> /* We have to scale win.x and win.y offsets */
> if ( (cam->largeview && !(cam->vpp_flag & VPP_UPSCALE))
> || (cam->vpp_flag & VPP_UPSCALE) ) {
> - ax = __SC(win.x)/fw;
> - ay = __SC(win.y)/fh;
> + ax = SC(win.x)/fw;
> + ay = SC(win.y)/fh;
> } else {
> ax = win.x;
> ay = win.y;
> @@ -1917,8 +1917,8 @@ w9968cf_set_window(struct w9968cf_device
> /* Adjust win.x, win.y */
> if ( (cam->largeview && !(cam->vpp_flag & VPP_UPSCALE))
> || (cam->vpp_flag & VPP_UPSCALE) ) {
> - win.x = __UNSC(ax*fw);
> - win.y = __UNSC(ay*fh);
> + win.x = UNSC(ax*fw);
> + win.y = UNSC(ay*fh);
> } else {
> win.x = ax;
> win.y = ay;
>
>
prev parent reply other threads:[~2006-12-11 20:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-10 19:41 Ralf Baechle
2006-12-11 20:01 ` luca.risolia [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=1165867286.457db9169cf67@posta.studio.unibo.it \
--to=luca.risolia@studio.unibo.it \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=mchehab@infradead.org \
--cc=ralf@linux-mips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®