mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Yang Li <yang.lee@linux.alibaba.com>
Cc: Johan Hedberg <johan.hedberg@gmail.com>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	linux-bluetooth <linux-bluetooth@vger.kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] Bluetooth: btusb: Fix the application of sizeof to pointer
Date: Fri, 10 Sep 2021 09:33:45 +0200	[thread overview]
Message-ID: <AE0FD6C9-75DA-49E3-91F9-6F095284BCB2@holtmann.org> (raw)
In-Reply-To: <1630653392-45523-1-git-send-email-yang.lee@linux.alibaba.com>

Hi Yang,

> sizeof() when applied to a pointer typed expression gives the size of
> the pointer.
> 
> Clean up coccicheck warning:
> ./drivers/bluetooth/btusb.c:2210:36-42: ERROR: application of sizeof to
> pointer
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
> drivers/bluetooth/btusb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 928cbfa..5bf479e 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -2207,7 +2207,7 @@ static int btusb_set_bdaddr_mtk(struct hci_dev *hdev, const bdaddr_t *bdaddr)
> 	struct sk_buff *skb;
> 	long ret;
> 
> -	skb = __hci_cmd_sync(hdev, 0xfc1a, sizeof(bdaddr), bdaddr, HCI_INIT_TIMEOUT);
> +	skb = __hci_cmd_sync(hdev, 0xfc1a, sizeof(*bdaddr), bdaddr, HCI_INIT_TIMEOUT);

lets just do 0xfc1a, 6, bdaddr like the other functions do as well.

Regards

Marcel


      reply	other threads:[~2021-09-10  7:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03  7:16 Yang Li
2021-09-10  7:33 ` Marcel Holtmann [this message]

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=AE0FD6C9-75DA-49E3-91F9-6F095284BCB2@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=yang.lee@linux.alibaba.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

all inboxes | Powered by JetHome®