From: Marcel Holtmann <marcel@holtmann.org>
To: Syam Sidhardhan <s.syam@samsung.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 4/5] Bluetooth: mgmt: Use __constant when dealing with constants
Date: Tue, 23 Oct 2012 07:46:08 -0700 [thread overview]
Message-ID: <1351003568.1785.30.camel@aeonflux> (raw)
In-Reply-To: <1350999140-7481-4-git-send-email-s.syam@samsung.com>
Hi Syam,
> __constant_cpu_to_le*() is the right go here.
>
> Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
> ---
> net/bluetooth/mgmt.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index b127b88..e3bb2a7 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -222,7 +222,7 @@ static int cmd_status(struct sock *sk, u16 index, u16 cmd, u8 status)
>
> hdr = (void *) skb_put(skb, sizeof(*hdr));
>
> - hdr->opcode = cpu_to_le16(MGMT_EV_CMD_STATUS);
> + hdr->opcode = __constant_cpu_to_le16(MGMT_EV_CMD_STATUS);
> hdr->index = cpu_to_le16(index);
> hdr->len = cpu_to_le16(sizeof(*ev));
>
> @@ -253,7 +253,7 @@ static int cmd_complete(struct sock *sk, u16 index, u16 cmd, u8 status,
>
> hdr = (void *) skb_put(skb, sizeof(*hdr));
>
> - hdr->opcode = cpu_to_le16(MGMT_EV_CMD_COMPLETE);
> + hdr->opcode = __constant_cpu_to_le16(MGMT_EV_CMD_COMPLETE);
> hdr->index = cpu_to_le16(index);
> hdr->len = cpu_to_le16(sizeof(*ev) + rp_len);
>
> @@ -832,7 +832,7 @@ static int mgmt_event(u16 event, struct hci_dev *hdev, void *data, u16 data_len,
> if (hdev)
> hdr->index = cpu_to_le16(hdev->id);
> else
> - hdr->index = cpu_to_le16(MGMT_INDEX_NONE);
> + hdr->index = __constant_cpu_to_le16(MGMT_INDEX_NONE);
> hdr->len = cpu_to_le16(data_len);
>
> if (data)
> @@ -3570,9 +3570,11 @@ int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
> ev->addr.type = link_to_bdaddr(link_type, addr_type);
> ev->rssi = rssi;
> if (cfm_name)
> - ev->flags |= cpu_to_le32(MGMT_DEV_FOUND_CONFIRM_NAME);
> + ev->flags |=
> + __constant_cpu_to_le32(MGMT_DEV_FOUND_CONFIRM_NAME);
> if (!ssp)
> - ev->flags |= cpu_to_le32(MGMT_DEV_FOUND_LEGACY_PAIRING);
> + ev->flags |=
> + __constant_cpu_to_le32(MGMT_DEV_FOUND_LEGACY_PAIRING);
for these ones, break the 80 chars rule. In this case that is
acceptable.
Regards
Marcel
next prev parent reply other threads:[~2012-10-23 14:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-23 13:32 [PATCH 1/5] Bluetooth: trivial: Remove newline before EOF Syam Sidhardhan
2012-10-23 13:32 ` [PATCH 2/5] Bluetooth: Remove unnecessary include export.h Syam Sidhardhan
2012-10-23 14:44 ` Marcel Holtmann
2012-10-29 15:03 ` Syam Sidhardhan
2012-10-31 18:21 ` Gustavo Padovan
2012-10-23 13:32 ` [PATCH 3/5] Bluetooth: Replace include linux/module.h with linux/export.h Syam Sidhardhan
2012-10-23 14:45 ` Marcel Holtmann
2012-10-24 2:47 ` Gustavo Padovan
2012-10-23 13:32 ` [PATCH 4/5] Bluetooth: mgmt: Use __constant when dealing with constants Syam Sidhardhan
2012-10-23 14:46 ` Marcel Holtmann [this message]
2012-10-29 15:05 ` Syam Sidhardhan
2012-10-23 13:32 ` [PATCH v1 5/5] Bluetooth: Fix L2CAP dynamic PSM bind issue Syam Sidhardhan
2012-10-23 14:52 ` Marcel Holtmann
2012-10-23 14:43 ` [PATCH 1/5] Bluetooth: trivial: Remove newline before EOF Marcel Holtmann
2012-10-24 2:46 ` Gustavo Padovan
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=1351003568.1785.30.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=s.syam@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 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.