From: Johan Hovold <johan@kernel.org>
To: Sean Wang <sean.wang@mediatek.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
Mark Rutland <mark.rutland@arm.com>,
devicetree <devicetree@vger.kernel.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
Marcel Holtmann <marcel@holtmann.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-bluetooth@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists.infradead.org>,
linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v4 6/7] Bluetooth: mediatek: Add protocol support for MediaTek serial devices
Date: Thu, 28 Jun 2018 07:19:41 +0200 [thread overview]
Message-ID: <20180628051941.GF629@localhost> (raw)
In-Reply-To: <1530155173.29697.48.camel@mtkswgap22>
On Thu, Jun 28, 2018 at 11:06:13AM +0800, Sean Wang wrote:
> On Wed, 2018-06-27 at 20:04 +0300, Andy Shevchenko wrote:
> > On Wed, Jun 27, 2018 at 7:59 PM, Andy Shevchenko
> > <andy.shevchenko@gmail.com> wrote:
> > > On Wed, Jun 27, 2018 at 8:43 AM, <sean.wang@mediatek.com> wrote:
> > >> From: Sean Wang <sean.wang@mediatek.com>
> > >> +#include <net/bluetooth/bluetooth.h>
> > >> +#include <net/bluetooth/hci_core.h>
> >
> > >> + /* Enable the power domain and clock the device requires. */
> > >> + pm_runtime_enable(dev);
> > >> + err = pm_runtime_get_sync(dev);
> > >> + if (err < 0)
> > >> + goto err_pm2;
> > >> +err_pm1:
> > >> + pm_runtime_put_sync(dev);
> > >> +err_pm2:
> > >> + pm_runtime_disable(dev);
Please name error labels after what they do, not using numbers (see
CodingStyle). Here you could use err_disable_rpm instead of err_pm2, for
example.
Also, if you really want to undo pm_runtime_get_sync() failing above,
you still need a pm_runtime_put_noidle() to balance the usage count.
> > >> +struct mtk_stp_hdr {
> > >> + __u8 prefix;
> > >> + __u8 dlen1:4;
> > >> + __u8 type:4;
> >
> > >> + __u8 dlen2:8;
> > >> + __u8 cs;
> > >> +} __packed;
Perhaps too much context have been lost here, but unless you're sharing
this struct with user space, you should be using u8 (without __) above
(and elsewhere).
Johan
WARNING: multiple messages have this Message-ID (diff)
From: johan@kernel.org (Johan Hovold)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 6/7] Bluetooth: mediatek: Add protocol support for MediaTek serial devices
Date: Thu, 28 Jun 2018 07:19:41 +0200 [thread overview]
Message-ID: <20180628051941.GF629@localhost> (raw)
In-Reply-To: <1530155173.29697.48.camel@mtkswgap22>
On Thu, Jun 28, 2018 at 11:06:13AM +0800, Sean Wang wrote:
> On Wed, 2018-06-27 at 20:04 +0300, Andy Shevchenko wrote:
> > On Wed, Jun 27, 2018 at 7:59 PM, Andy Shevchenko
> > <andy.shevchenko@gmail.com> wrote:
> > > On Wed, Jun 27, 2018 at 8:43 AM, <sean.wang@mediatek.com> wrote:
> > >> From: Sean Wang <sean.wang@mediatek.com>
> > >> +#include <net/bluetooth/bluetooth.h>
> > >> +#include <net/bluetooth/hci_core.h>
> >
> > >> + /* Enable the power domain and clock the device requires. */
> > >> + pm_runtime_enable(dev);
> > >> + err = pm_runtime_get_sync(dev);
> > >> + if (err < 0)
> > >> + goto err_pm2;
> > >> +err_pm1:
> > >> + pm_runtime_put_sync(dev);
> > >> +err_pm2:
> > >> + pm_runtime_disable(dev);
Please name error labels after what they do, not using numbers (see
CodingStyle). Here you could use err_disable_rpm instead of err_pm2, for
example.
Also, if you really want to undo pm_runtime_get_sync() failing above,
you still need a pm_runtime_put_noidle() to balance the usage count.
> > >> +struct mtk_stp_hdr {
> > >> + __u8 prefix;
> > >> + __u8 dlen1:4;
> > >> + __u8 type:4;
> >
> > >> + __u8 dlen2:8;
> > >> + __u8 cs;
> > >> +} __packed;
Perhaps too much context have been lost here, but unless you're sharing
this struct with user space, you should be using u8 (without __) above
(and elsewhere).
Johan
next prev parent reply other threads:[~2018-06-28 5:19 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 5:43 [PATCH v4 0/7] add support for Bluetooth on MT7622 SoC sean.wang
2018-06-27 5:43 ` sean.wang at mediatek.com
2018-06-27 5:43 ` sean.wang
2018-06-27 5:43 ` [PATCH v4 1/7] dt-bindings: net: bluetooth: Add mediatek-bluetooth sean.wang
2018-06-27 5:43 ` sean.wang at mediatek.com
2018-06-27 5:43 ` sean.wang
2018-06-27 5:43 ` [PATCH v4 2/7] serdev: add dev_pm_domain_attach|detach() sean.wang
2018-06-27 5:43 ` sean.wang at mediatek.com
2018-06-27 5:43 ` sean.wang
2018-06-27 8:00 ` Ulf Hansson
2018-06-27 8:00 ` Ulf Hansson
2018-06-27 5:43 ` [PATCH v4 3/7] Bluetooth: Add new serdev based driver for UART attached controllers sean.wang
2018-06-27 5:43 ` sean.wang at mediatek.com
2018-06-27 5:43 ` sean.wang
2018-06-27 5:43 ` [PATCH v4 4/7] Bluetooth: Add new quirk for non-persistent setup settings sean.wang
2018-06-27 5:43 ` sean.wang at mediatek.com
2018-06-27 5:43 ` sean.wang
2018-06-27 5:43 ` [PATCH v4 5/7] Bluetooth: Extend btuart driver for join more vendor devices sean.wang
2018-06-27 5:43 ` sean.wang at mediatek.com
2018-06-27 5:43 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-06-27 5:43 ` [PATCH v4 6/7] Bluetooth: mediatek: Add protocol support for MediaTek serial devices sean.wang
2018-06-27 5:43 ` sean.wang at mediatek.com
2018-06-27 5:43 ` sean.wang
2018-06-27 16:59 ` Andy Shevchenko
2018-06-27 16:59 ` Andy Shevchenko
2018-06-27 17:04 ` Andy Shevchenko
2018-06-27 17:04 ` Andy Shevchenko
2018-06-28 3:06 ` Sean Wang
2018-06-28 3:06 ` Sean Wang
2018-06-28 3:06 ` Sean Wang
2018-06-28 5:19 ` Johan Hovold [this message]
2018-06-28 5:19 ` Johan Hovold
2018-06-29 9:47 ` Sean Wang
2018-06-29 9:47 ` Sean Wang
2018-06-29 9:47 ` Sean Wang
2018-06-28 2:54 ` Sean Wang
2018-06-28 2:54 ` Sean Wang
2018-06-28 2:54 ` Sean Wang
2018-06-27 5:43 ` [PATCH v4 7/7] MAINTAINERS: add an entry for MediaTek Bluetooth driver sean.wang
2018-06-27 5:43 ` sean.wang at mediatek.com
2018-06-27 5:43 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
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=20180628051941.GF629@localhost \
--to=johan@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=johan.hedberg@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=marcel@holtmann.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=sean.wang@mediatek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.