From: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
To: Orson Zhai <orsonzhai@gmail.com>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"Zhizhou Zhang ( 张治洲)" <zhizhou.zhang@spreadtrum.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Pawel Moll" <pawel.moll@arm.com>,
"Chunyan Zhang" <chunyan.zhang@spreadtrum.com>,
"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Mark Brown" <broonie@linaro.org>,
"Will Deacon" <will.deacon@arm.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"Geng Ren ( 任赓)" <geng.ren@spreadtrum.com>,
"rrichter@cavium.com" <rrichter@cavium.com>,
"m-karicheri2@ti.com" <m-karicheri2@ti.com>,
"Kumar Gala" <galak@codeaurora.org>,
"jslaby@suse.cz" <jslaby@suse.cz>,
sprdlinux <sprdlinux@freelists.org>,
linux-arm-kernel@lists.inf
Subject: Re: [PATCH v2 5/5] tty/serial: Add earlycon support for Spreadtrum serial driver
Date: Tue, 21 Oct 2014 13:26:30 +0100 [thread overview]
Message-ID: <20141021132630.79ce15ba@alan.etchedpixels.co.uk> (raw)
In-Reply-To: <CA+H2tpH2dKFHxHUaGtr-vEqxZDtQ_MVTmQTnu5kn-zzUFyXk4Q@mail.gmail.com>
On Mon, 20 Oct 2014 18:23:38 +0800
Orson Zhai <orsonzhai@gmail.com> wrote:
> On Sun, Oct 19, 2014 at 5:06 AM, One Thousand Gnomes
> <gnomes@lxorguk.ukuu.org.uk> wrote:
> > On Fri, 17 Oct 2014 17:54:25 +0800
> > Chunyan Zhang <chunyan.zhang@spreadtrum.com> wrote:
> >
> >> Add serial driver for spreadtrum sharkl platform with earlycon
> >> support at first.
> >
> >> +#define UART_TXD 0x0000
> >> +#define UART_RXD 0x0004
> >> +#define UART_STS0 0x0008
> >> +#define UART_STS1 0x000C
> >> +#define UART_IEN 0x0010
> >> +#define UART_ICLR 0x0014
> >> +#define UART_CTL0 0x0018
> >> +#define UART_CTL1 0x001C
> >> +#define UART_CTL2 0x0020
> >> +#define UART_CLKD0 0x0024
> >> +#define UART_CLKD1 0x0028
> >> +#define UART_STS2 0x002C
> >> +
> >> +/*line status */
> >> +#define UART_LSR_TX_OVER (0x1<<15)
> >
> > Given we use UART_ for all the 8250 defines it might be better to use
> > something else - SHARK_LSR_TX_OVER etc to avoid future confusion
> >
>
> Does it matter if those macro are only used in the specific c file?
> >From my point of view, private register macro could be treated as
> static definitions like static variable or functions in C file.
> I also noted that many people use a prefix for the other
> manufacturers' macro definition in source file .
> I have no intention to break the habit of kernel but just for discussion.
Your problem is this. In the kernel headers are definitions like
include/uapi/linux/serial_reg.h:#define UART_TX 0 /* Out: Transmit
buffer */
you are adding identical (but conflicting in places) defines. If some
random change in the include files causes serial_reg.h to be included by
a header you include then it will break.
In addition people habitually use tools like LXR to figure out where
defines and functions are. Having these conflicting definitions will
cause confusion. Better they have prefixes.
Alan
next prev parent reply other threads:[~2014-10-21 12:26 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <sprd-1017-v2>
2014-10-17 9:54 ` [PATCH v2 0/5] Add Spreadtrum Sharkl Platform support Chunyan Zhang
2014-10-17 9:54 ` [PATCH v2 1/5] Documentation: DT: Renamed of-serial.txt to 8250.txt Chunyan Zhang
2014-10-17 13:12 ` Mark Rutland
2014-10-20 13:47 ` Arnd Bergmann
2014-10-17 9:54 ` [PATCH v2 2/5] Documentation: DT: Add bindings for Spreadtrum Sharkl Platform Chunyan Zhang
2014-10-17 12:50 ` Mark Rutland
2014-10-20 13:48 ` Arnd Bergmann
2014-10-17 9:54 ` [PATCH v2 3/5] arm64: dts: Add support for Spreadtrum Sharkl3 SoC in dts and Makefile Chunyan Zhang
2014-10-17 13:00 ` Mark Rutland
2014-10-17 9:54 ` [PATCH v2 4/5] arm64: Add support for Spreadtrum's Sharkl Platform in Kconfig and defconfig Chunyan Zhang
2014-10-17 9:54 ` [PATCH v2 5/5] tty/serial: Add earlycon support for Spreadtrum serial driver Chunyan Zhang
[not found] ` <1413539665-11484-6-git-send-email-chunyan.zhang-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>
2014-10-17 13:03 ` Mark Rutland
2014-10-20 7:27 ` Lyra Zhang
2014-10-20 10:32 ` Mark Rutland
2014-10-20 11:15 ` Lyra Zhang
2014-10-18 21:06 ` One Thousand Gnomes
2014-10-20 10:23 ` Orson Zhai
2014-10-21 12:26 ` One Thousand Gnomes [this message]
2014-10-21 13:34 ` Orson Zhai
2014-10-21 11:15 ` [PATCH v2 0/5] Add Spreadtrum Sharkl Platform support Pavel Machek
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=20141021132630.79ce15ba@alan.etchedpixels.co.uk \
--to=gnomes@lxorguk.ukuu.org.uk \
--cc=broonie@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=chunyan.zhang@spreadtrum.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=geng.ren@spreadtrum.com \
--cc=gregkh@linuxfoundation.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jslaby@suse.cz \
--cc=linux-arm-kernel@lists.inf \
--cc=linux-kernel@vger.kernel.org \
--cc=m-karicheri2@ti.com \
--cc=mark.rutland@arm.com \
--cc=orsonzhai@gmail.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=rrichter@cavium.com \
--cc=sprdlinux@freelists.org \
--cc=will.deacon@arm.com \
--cc=zhizhou.zhang@spreadtrum.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;
as well as URLs for NNTP newsgroup(s).