From: Ondrej Zajicek <santiago@crfreenet.org>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: James Simmons <jsimmons@infradead.org>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org,
linux-fbdev-devel@lists.sourceforge.net
Subject: Re: [PATCH] fbdev driver for S3 Trio/Virge
Date: Tue, 6 Feb 2007 22:17:46 +0100 [thread overview]
Message-ID: <20070206211746.GA31501@localhost.localdomain> (raw)
In-Reply-To: <45C7B0A8.50707@gmail.com>
On Mon, Feb 05, 2007 at 11:33:12PM +0100, Jiri Slaby wrote:
> Ondrej Zajicek napsal(a):
> >This patch adds driver for S3 Trio / S3 Virge. Driver is tested
> >with most versions of S3 Trio and S3 Virge, on i386.
> >It is tested both as compiled-in and module. It is against
> >linux-2.6.20 .
Thank you for comments. I appreciated them.
> >+#ifdef CONFIG_MTRR
> >+#include <asm/mtrr.h>
> >+#endif
>
> Why ifdef? It's ifdeffed in the header itself.
But this header is only available on some archs, isn't it?
> >+static int s3fb_open(struct fb_info *info, int user)
> >+{
> >+ struct s3fb_info *par = (struct s3fb_info *) info;
> >+ unsigned int count = atomic_read(&(par->ref_count));
> >+
> >+ if (!count) {
>
> bad
>
> >+ memset(&(par->state), 0, sizeof(struct vgastate));
> >+ par->state.flags = VGA_SAVE_MODE | VGA_SAVE_FONTS |
> >VGA_SAVE_CMAP;
> >+ par->state.num_crtc = 0x70;
> >+ par->state.num_seq = 0x20;
> >+ save_vga(&(par->state));
> >+ }
> >+
> >+ atomic_inc(&(par->ref_count));
> >+
> >+ return 0;
> >+}
This pattern is in several fbdev drivers (neofb, i810fb, rivafb, vga16fb).
I understand the problem but i am not sure what is the best solution.
Maybe acquire/release console semaphore before/after s3fb_open?
> >+static int s3fb_release(struct fb_info *info, int user)
> >+{
> >+ struct s3fb_info *par = (struct s3fb_info *) info;
>
> Use container_of for this (and below/above).
Isn't container_of overkill for this case?
> >+struct vga_regset {
> >+ __u8 regnum;
> >+ __u8 lowbit;
> >+ __u8 highbit;
>
> You use no __ variants, why __u8 here?
No reason. I will replace it to u8, which is more appropriate.
--
Ondrej 'SanTiago' Zajicek (email: santiago@mail.cz, jabber: santiago@njs.netlab.cz)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
next prev parent reply other threads:[~2007-02-06 21:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-05 19:51 [PATCH] fbdev driver for S3 Trio/Virge Ondrej Zajicek
2007-02-05 22:33 ` Jiri Slaby
2007-02-06 21:17 ` Ondrej Zajicek [this message]
2007-02-06 22:51 ` Jiri Slaby
2007-02-06 21:23 ` Philippe De Muyter
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=20070206211746.GA31501@localhost.localdomain \
--to=santiago@crfreenet.org \
--cc=akpm@osdl.org \
--cc=jirislaby@gmail.com \
--cc=jsimmons@infradead.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).