From: Szymon Janc <szymon.janc@tieto.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] android/pan: Generate file path in compile time
Date: Mon, 13 Jan 2014 11:00:18 +0100 [thread overview]
Message-ID: <1933000.xY1JAbUgSt@uw000953> (raw)
In-Reply-To: <1389604100-26189-1-git-send-email-szymon.janc@tieto.com>
Hi,
On Monday 13 of January 2014 10:08:20 Szymon Janc wrote:
> This reduce need of using snprintf function and removes need of manual
> buffer size calculation.
> ---
> android/pan.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/android/pan.c b/android/pan.c
> index 205da71..dfd7762 100644
> --- a/android/pan.c
> +++ b/android/pan.c
> @@ -50,9 +50,9 @@
> #include "bluetooth.h"
>
> #define SVC_HINT_NETWORKING 0x02
> -#define BNEP_BRIDGE "bnep"
> -#define FORWARD_DELAY_PATH "/sys/class/net/%s/bridge/forward_delay"
> -#define DELAY_PATH_MAX 41
> +
> +#define BNEP_BRIDGE "bnep"
> +#define FORWARD_DELAY_PATH "/sys/class/net/"BNEP_BRIDGE"/bridge/forward_delay"
>
> static bdaddr_t adapter_addr;
> GSList *devices = NULL;
> @@ -470,11 +470,8 @@ failed:
> static int set_forward_delay(void)
> {
> int fd, ret;
> - char path[DELAY_PATH_MAX];
> -
> - snprintf(path, sizeof(path), FORWARD_DELAY_PATH, BNEP_BRIDGE);
>
> - fd = open(path, O_RDWR);
> + fd = open(FORWARD_DELAY_PATH, O_RDWR);
> if (fd < 0)
> return -errno;
>
This is now upstream.
--
Best regards,
Szymon Janc
prev parent reply other threads:[~2014-01-13 10:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-13 9:08 [PATCH] android/pan: Generate file path in compile time Szymon Janc
2014-01-13 10:00 ` Szymon Janc [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=1933000.xY1JAbUgSt@uw000953 \
--to=szymon.janc@tieto.com \
--cc=linux-bluetooth@vger.kernel.org \
/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