lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1530155173.29697.48.camel@mtkswgap22>
Date:   Thu, 28 Jun 2018 11:06:13 +0800
From:   Sean Wang <sean.wang@...iatek.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
CC:     Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Marcel Holtmann <marcel@...tmann.org>,
        Johan Hedberg <johan.hedberg@...il.com>,
        devicetree <devicetree@...r.kernel.org>,
        <linux-bluetooth@...r.kernel.org>,
        linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-mediatek@...ts.infradead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 6/7] Bluetooth: mediatek: Add protocol support for
 MediaTek serial devices

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@...il.com> wrote:
> > On Wed, Jun 27, 2018 at 8:43 AM,  <sean.wang@...iatek.com> wrote:
> >> From: Sean Wang <sean.wang@...iatek.com>
> >>
> >
> >> +config BT_HCIBTUART_MTK
> >> +       tristate "MediaTek HCI UART driver"
> >> +       depends on BT_HCIBTUART
> >
> >> +       default y
> >
> > Perhaps it's an overkill for users which would like to have less
> > amount on stuff in kernel.
> >

Sure, the default y will be removed

> >
> >> +#include <asm/unaligned.h>
> >> +#include <linux/atomic.h>
> >> +#include <linux/clk.h>
> >> +#include <linux/firmware.h>
> >> +#include <linux/module.h>
> >> +#include <linux/pm_runtime.h>
> >> +#include <linux/serdev.h>
> 
> Perhaps alphabetically ordered?
> 

They seem already in alphabetically ordered

> + blank line.
> 

A blank line will be added here

> >
> >> +#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;
> 
> Should be err_pm1 here.

Label err_pm1 and err_pm2 can be swapped for the readability and this
doesn't have any effect on the logic.

> Yes, that's correct.
> 
> >> +err_pm1:
> >> +       pm_runtime_put_sync(dev);
> >> +err_pm2:
> >> +       pm_runtime_disable(dev);
> 
> >> +#define MTK_WMT_CMD_SIZE       (MTK_WMT_HDR_SIZE + MTK_STP_HDR_SIZE + \
> >> +                                MTK_STP_TLR_SIZE + HCI_ACL_HDR_SIZE)
> 
> It would look slightly better if you start on new line like
> #define FOO \
>  (BAR + BAZ)
> 

Thanks for your pointing out. I also found that the macro is not being
used by anyone, it can be removed freely.

> >> +struct mtk_stp_hdr {
> >> +       __u8 prefix;
> >> +       __u8 dlen1:4;
> >> +       __u8 type:4;
> 
> >> +       __u8 dlen2:8;
> 
> u8 already 8 bit.
> 

the superfluous :8 for dlen2 will be removed

> >> +       __u8 cs;
> >> +} __packed;
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ