linux-snps-arc.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Javier Martinez Canillas <javierm@redhat.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
	Sam Ravnborg <sam@ravnborg.org>,
	linux-arch@vger.kernel.org,  linux-fbdev@vger.kernel.org,
	linux-ia64@vger.kernel.org,  loongarch@lists.linux.dev,
	arnd@arndb.de, deller@gmx.de,  chenhuacai@kernel.org,
	dri-devel@lists.freedesktop.org,  linux-kernel@vger.kernel.org,
	James.Bottomley@hansenpartnership.com,
	 linux-m68k@lists.linux-m68k.org, linux-parisc@vger.kernel.org,
	 vgupta@kernel.org, sparclinux@vger.kernel.org,
	kernel@xen0n.name,  linux-snps-arc@lists.infradead.org,
	davem@davemloft.net,  linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 4/6] fbdev: Include <linux/io.h> via <asm/fb.h>
Date: Wed, 3 May 2023 10:09:39 +0200	[thread overview]
Message-ID: <CAMuHMdW8Sm7sBu47XQ1xygn6fzq2FzQeiuK0ncMVGHan-_k4Ow@mail.gmail.com> (raw)
In-Reply-To: <87354dyj9i.fsf@minerva.mail-host-address-is-not-set>

On Wed, May 3, 2023 at 9:19 AM Javier Martinez Canillas
<javierm@redhat.com> wrote:
> Thomas Zimmermann <tzimmermann@suse.de> writes:
> > Am 02.05.23 um 21:54 schrieb Sam Ravnborg:
> >> On Tue, May 02, 2023 at 03:02:21PM +0200, Thomas Zimmermann wrote:
>
> [...]
>
> >>>   #include <linux/console.h> /* Why should fb driver call console functions? because console_lock() */
> >>>   #include <video/vga.h>
> >>>
> >>> +#include <asm/fb.h>
> >>
> >> When we have a header like linux/fb.h - it is my understanding that it is
> >> preferred to include that file, and not the asm/fb.h variant.
> >>
> >> This is assuming the linux/fb.h contains the generic stuff, and includes
> >> asm/fb.h for the architecture specific parts.
> >>
> >> So drivers will include linux/fb.h and then they automatically get the
> >> architecture specific parts from asm/fb.h.
> >>
> >> In other words, drivers are not supposed to include asm/fb.h, if
> >> linux.fb.h exists - and linux/fb.h shall include the asm/fb.h.
> >>
> >> If the above holds true, then it is wrong and not needed to add asm/fb.h
> >> as seen above.
> >>
> >>
> >> There are countless examples where the above are not followed,
> >> but to my best understanding the above it the preferred way to do it.
> >
> > Where did youher this? I only know about this in the case of asm/io.h
> > vs. linux/io.h.
> >
>
> I understand that's the case too. I believe even checkpatch.pl complains
> about it? (not that the script always get right, but just as an example).

One more to chime in: in general, drivers should only include <linux/foo.h>.
Including <asm/foo.h> directly is the exception.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

  reply	other threads:[~2023-05-03  8:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 13:02 [PATCH v3 0/6] fbdev: Move framebuffer I/O helpers to <asm/fb.h> Thomas Zimmermann
2023-05-02 13:02 ` [PATCH v3 1/6] fbdev/matrox: Remove trailing whitespaces Thomas Zimmermann
2023-05-02 13:02 ` [PATCH v3 2/6] ipu-v3: Include <linux/io.h> Thomas Zimmermann
2023-05-02 13:02 ` [PATCH v3 3/6] fbdev: Include <linux/io.h> in various drivers Thomas Zimmermann
2023-05-02 13:02 ` [PATCH v3 4/6] fbdev: Include <linux/io.h> via <asm/fb.h> Thomas Zimmermann
2023-05-02 19:54   ` Sam Ravnborg
2023-05-03  7:09     ` Thomas Zimmermann
2023-05-03  7:19       ` Javier Martinez Canillas
2023-05-03  8:09         ` Geert Uytterhoeven [this message]
2023-05-03  8:12         ` Thomas Zimmermann
2023-05-03  8:52           ` Arnd Bergmann
2023-05-02 13:02 ` [PATCH v3 5/6] fbdev: Move framebuffer I/O helpers into <asm/fb.h> Thomas Zimmermann
2023-05-02 20:03   ` Sam Ravnborg
2023-05-03  6:58     ` Thomas Zimmermann
2023-05-03 19:03       ` Sam Ravnborg
2023-05-02 20:06   ` Arnd Bergmann
2023-05-03 14:55     ` Thomas Zimmermann
2023-05-03 15:06       ` Arnd Bergmann
2023-05-02 13:02 ` [PATCH v3 6/6] fbdev: Rename fb_mem*() helpers Thomas Zimmermann
2023-05-02 20:08   ` Sam Ravnborg
2023-05-03  8:15     ` Thomas Zimmermann
2023-05-03 19:06       ` Sam Ravnborg
2023-05-03  8:21 ` [PATCH v3 0/6] fbdev: Move framebuffer I/O helpers to <asm/fb.h> Geert Uytterhoeven

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=CAMuHMdW8Sm7sBu47XQ1xygn6fzq2FzQeiuK0ncMVGHan-_k4Ow@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=arnd@arndb.de \
    --cc=chenhuacai@kernel.org \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=kernel@xen0n.name \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=loongarch@lists.linux.dev \
    --cc=sam@ravnborg.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=vgupta@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).