netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] Bluetooth: add printf format attribute to hci_set_[fh]w_info()
@ 2016-07-29 11:28 Nicolas Iooss
  2016-08-15  8:00 ` Nicolas Iooss
  2016-08-15  8:30 ` Johan Hedberg
  0 siblings, 2 replies; 3+ messages in thread
From: Nicolas Iooss @ 2016-07-29 11:28 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: linux-bluetooth, netdev, linux-kernel, Nicolas Iooss

Commit 5177a83827cd ("Bluetooth: Add debugfs fields for hardware and
firmware info") introduced hci_set_hw_info() and hci_set_fw_info().
These functions use kvasprintf_const() but are not marked with a
__printf attribute.  Adding such an attribute helps detecting issues
related to printf-formatting at build time.

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
---
 include/net/bluetooth/hci_core.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index ee7fc47680a1..012e5031fe47 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1026,8 +1026,8 @@ int hci_resume_dev(struct hci_dev *hdev);
 int hci_reset_dev(struct hci_dev *hdev);
 int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb);
 int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb);
-void hci_set_hw_info(struct hci_dev *hdev, const char *fmt, ...);
-void hci_set_fw_info(struct hci_dev *hdev, const char *fmt, ...);
+__printf(2, 3) void hci_set_hw_info(struct hci_dev *hdev, const char *fmt, ...);
+__printf(2, 3) void hci_set_fw_info(struct hci_dev *hdev, const char *fmt, ...);
 int hci_dev_open(__u16 dev);
 int hci_dev_close(__u16 dev);
 int hci_dev_do_close(struct hci_dev *hdev);
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] Bluetooth: add printf format attribute to hci_set_[fh]w_info()
  2016-07-29 11:28 [PATCH 1/1] Bluetooth: add printf format attribute to hci_set_[fh]w_info() Nicolas Iooss
@ 2016-08-15  8:00 ` Nicolas Iooss
  2016-08-15  8:30 ` Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Iooss @ 2016-08-15  8:00 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: linux-bluetooth, netdev, linux-kernel

Hello,
After I sent the following patch a few weeks ago, I have not received
any feedback. Could you please review it?

Thanks,
Nicolas

On 29/07/16 13:28, Nicolas Iooss wrote:
> Commit 5177a83827cd ("Bluetooth: Add debugfs fields for hardware and
> firmware info") introduced hci_set_hw_info() and hci_set_fw_info().
> These functions use kvasprintf_const() but are not marked with a
> __printf attribute.  Adding such an attribute helps detecting issues
> related to printf-formatting at build time.
> 
> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
> ---
>  include/net/bluetooth/hci_core.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
> index ee7fc47680a1..012e5031fe47 100644
> --- a/include/net/bluetooth/hci_core.h
> +++ b/include/net/bluetooth/hci_core.h
> @@ -1026,8 +1026,8 @@ int hci_resume_dev(struct hci_dev *hdev);
>  int hci_reset_dev(struct hci_dev *hdev);
>  int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb);
>  int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb);
> -void hci_set_hw_info(struct hci_dev *hdev, const char *fmt, ...);
> -void hci_set_fw_info(struct hci_dev *hdev, const char *fmt, ...);
> +__printf(2, 3) void hci_set_hw_info(struct hci_dev *hdev, const char *fmt, ...);
> +__printf(2, 3) void hci_set_fw_info(struct hci_dev *hdev, const char *fmt, ...);
>  int hci_dev_open(__u16 dev);
>  int hci_dev_close(__u16 dev);
>  int hci_dev_do_close(struct hci_dev *hdev);
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] Bluetooth: add printf format attribute to hci_set_[fh]w_info()
  2016-07-29 11:28 [PATCH 1/1] Bluetooth: add printf format attribute to hci_set_[fh]w_info() Nicolas Iooss
  2016-08-15  8:00 ` Nicolas Iooss
@ 2016-08-15  8:30 ` Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2016-08-15  8:30 UTC (permalink / raw)
  To: Nicolas Iooss; +Cc: Marcel Holtmann, linux-bluetooth, netdev, linux-kernel

Hi Nicolas,

On Fri, Jul 29, 2016, Nicolas Iooss wrote:
> Commit 5177a83827cd ("Bluetooth: Add debugfs fields for hardware and
> firmware info") introduced hci_set_hw_info() and hci_set_fw_info().
> These functions use kvasprintf_const() but are not marked with a
> __printf attribute.  Adding such an attribute helps detecting issues
> related to printf-formatting at build time.
> 
> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
> ---
>  include/net/bluetooth/hci_core.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to bluetooth-next. Thanks.

Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-15  8:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-29 11:28 [PATCH 1/1] Bluetooth: add printf format attribute to hci_set_[fh]w_info() Nicolas Iooss
2016-08-15  8:00 ` Nicolas Iooss
2016-08-15  8:30 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).