From: Varka Bhadram <varkabhadram@gmail.com>
To: Stefan Schmidt <stefan@osg.samsung.com>, linux-wpan@vger.kernel.org
Cc: Alexander Aring <alex.aring@gmail.com>,
Stefan Schmidt <s.schmidt@samsung.com>
Subject: Re: [PATCH bluetooth-next 1/4] ieee802154/atusb: Add function for partial register writes
Date: Fri, 29 May 2015 12:29:52 +0530 [thread overview]
Message-ID: <55680E68.6030001@gmail.com> (raw)
In-Reply-To: <1432849607-24491-2-git-send-email-stefan@osg.samsung.com>
Hi Stefan,
I found two checkpatch issues on this patch.. See inline
On 05/29/2015 03:16 AM, Stefan Schmidt wrote:
> From: Stefan Schmidt <s.schmidt@samsung.com>
>
> With this function we can set individual bits in the registers if needed.
> With the old SR_VALUE macro we could only set one bit in the register
> which was ok for some scenarios but not for all. With this subreg write
> function we can now set more bits defined by the mask while not touching
> the rest.
>
> We start using it for the current SR_VALUE use case and will use it more
> in upcoming patches.
>
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
> drivers/net/ieee802154/atusb.c | 44 +++++++++++++++++++++++++-----------------
> 1 file changed, 26 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
> index 5b6bb9a..93431a5 100644
> --- a/drivers/net/ieee802154/atusb.c
> +++ b/drivers/net/ieee802154/atusb.c
> @@ -58,17 +58,6 @@ struct atusb {
> uint8_t tx_ack_seq; /* current TX ACK sequence number */
> };
>
> -/* at86rf230.h defines values as <reg, mask, shift> tuples. We use the more
> - * traditional style of having registers and or-able values. SR_REG extracts
> - * the register number. SR_VALUE uses the shift to prepare a value accordingly.
> - */
> -
> -#define __SR_REG(reg, mask, shift) (reg)
> -#define SR_REG(sr) __SR_REG(sr)
> -
> -#define __SR_VALUE(reg, mask, shift, val) ((val) << (shift))
> -#define SR_VALUE(sr, val) __SR_VALUE(sr, (val))
> -
> /* ----- USB commands without data ----------------------------------------- */
>
> /* To reduce the number of error checks in the code, we record the first error
> @@ -130,6 +119,29 @@ static int atusb_read_reg(struct atusb *atusb, uint8_t reg)
> return ret >= 0 ? value : ret;
> }
>
> +static int atusb_write_subreg(struct atusb *atusb, uint8_t reg, uint8_t mask,
> + uint8_t shift, uint8_t value)
> +{
> + struct usb_device *usb_dev = atusb->usb_dev;
> + uint8_t orig, tmp;
> + int ret = 0;
> +
> + dev_dbg(&usb_dev->dev, "atusb_write_subreg: 0x%02x <- 0x%02x\n",
> + reg, value);
CHECK: Alignment should match open parenthesis
#56: FILE: drivers/net/ieee802154/atusb.c:130:
+ dev_dbg(&usb_dev->dev, "atusb_write_subreg: 0x%02x <- 0x%02x\n",
+ reg, value);
> +
> + orig = atusb_read_reg(atusb, reg);
> +
> + /* Write the value only into that part of the register which is allowed
> + * by the mask. All other bits stay as before. */
WARNING: networking block comments put the trailing */ on a separate line
#61: FILE: drivers/net/ieee802154/atusb.c:135:
+ * by the mask. All other bits stay as before. */
regards,
--
Varka Bhadram
next prev parent reply other threads:[~2015-05-29 7:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 21:46 [PATCH bluetooth-next 0/4] Atusb driver improvements Stefan Schmidt
2015-05-28 21:46 ` [PATCH bluetooth-next 1/4] ieee802154/atusb: Add function for partial register writes Stefan Schmidt
2015-05-29 6:59 ` Varka Bhadram [this message]
2015-05-29 8:31 ` Stefan Schmidt
2015-05-28 21:46 ` [PATCH bluetooth-next 2/4] ieee802154/atusb: Add .set_txpower operation to the driver Stefan Schmidt
2015-05-28 21:46 ` [PATCH bluetooth-next 3/4] ieee802154/atusb: Add .set_promiscuous_mode driver operation Stefan Schmidt
2015-05-28 21:46 ` [PATCH bluetooth-next 4/4] MAINTAINERS: Add myself as maintainer for the atusb driver Stefan Schmidt
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=55680E68.6030001@gmail.com \
--to=varkabhadram@gmail.com \
--cc=alex.aring@gmail.com \
--cc=linux-wpan@vger.kernel.org \
--cc=s.schmidt@samsung.com \
--cc=stefan@osg.samsung.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