From: Kent Gibson <warthog618@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Pali Rohár" <pali@kernel.org>,
"Shawn Guo" <shawn.guo@linaro.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] PCI: mvebu: switch to using gpiod API
Date: Mon, 19 Sep 2022 07:58:38 +0800 [thread overview]
Message-ID: <Yyewrm+/viScefKC@sol> (raw)
In-Reply-To: <CAMRc=MeF2uNmx_-mZikg=3nMV4aHK+bCUBEcLGEgJ6JY4jZ_Sg@mail.gmail.com>
On Fri, Sep 16, 2022 at 09:22:59AM +0200, Bartosz Golaszewski wrote:
> On Thu, Sep 15, 2022 at 11:30 AM Kent Gibson <warthog618@gmail.com> wrote:
> >
> > Enums work for me - especially if the goal is to differentiate
> > logical from physical - there should be a distinct enum for each.
> >
>
> We won't even have to change the function signatures if we go with
> enums - they already take an int and I'm in general against putting
> enum types into function signatures in C as they give you a false
> sense of a strong type.
>
IMO it is far easier to remember that C doesn't range check enums than it
is to remember what specific values are appropriate for a function
accepting an enum as int. A specified type is a strong hint, and unlike
documentation is one that an IDE can parse and provide valid options for.
Passing enums as int is the norm in the kernel, so fair enough to keep
it that way, but that does contribute to the confusion that we are trying
to address here.
Cheers,
Kent.
next prev parent reply other threads:[~2022-09-18 23:58 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 20:43 [PATCH 1/2] PCI: histb: switch to using gpiod API Dmitry Torokhov
2022-09-06 20:43 ` [PATCH 2/2] PCI: mvebu: " Dmitry Torokhov
2022-09-06 21:16 ` Pali Rohár
2022-09-06 21:26 ` Dmitry Torokhov
2022-09-06 21:40 ` Dmitry Torokhov
2022-09-06 21:42 ` Pali Rohár
2022-09-06 21:41 ` Pali Rohár
2022-09-06 21:52 ` Dmitry Torokhov
2022-09-06 22:09 ` Pali Rohár
2022-09-06 22:41 ` Dmitry Torokhov
2022-09-11 12:58 ` Pali Rohár
2022-09-14 10:35 ` Linus Walleij
2022-09-14 12:10 ` Bartosz Golaszewski
2022-09-14 12:48 ` Linus Walleij
2022-09-14 13:00 ` Kent Gibson
2022-09-14 13:36 ` Linus Walleij
2022-09-15 2:23 ` Kent Gibson
2022-09-15 8:51 ` Linus Walleij
2022-09-15 9:30 ` Kent Gibson
2022-09-16 7:22 ` Bartosz Golaszewski
2022-09-18 14:37 ` Linus Walleij
2022-09-18 23:58 ` Kent Gibson [this message]
2022-09-08 8:42 ` Linus Walleij
2022-09-07 4:11 ` kernel test robot
2022-09-09 20:10 ` kernel test robot
2022-09-06 21:08 ` [PATCH 1/2] PCI: histb: " Pali Rohár
2022-09-06 21:41 ` Dmitry Torokhov
2022-09-06 21:46 ` Pali Rohár
2022-09-08 8:37 ` Linus Walleij
2022-11-11 15:01 ` Lorenzo Pieralisi
2022-11-11 15:20 ` Dmitry Torokhov
2022-11-14 10:58 ` (subset) " Lorenzo Pieralisi
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=Yyewrm+/viScefKC@sol \
--to=warthog618@gmail.com \
--cc=bhelgaas@google.com \
--cc=brgl@bgdev.pl \
--cc=dmitry.torokhov@gmail.com \
--cc=kw@linux.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=pali@kernel.org \
--cc=robh@kernel.org \
--cc=shawn.guo@linaro.org \
--cc=thomas.petazzoni@bootlin.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