linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>,
	ath10k@lists.infradead.org, Yanbo Li <yanbol@qca.qualcomm.com>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>,
	kvalo@codeaurora.org, mohammed@codeaurora.org,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH] ath10k: Fix return value for btcoex and peer stats debugfs
Date: Tue, 05 Apr 2016 10:28:56 -0700	[thread overview]
Message-ID: <1459877336.6715.6.camel@perches.com> (raw)
In-Reply-To: <1459870106-2694-1-git-send-email-mohammed@qca.qualcomm.com>

On Tue, 2016-04-05 at 20:58 +0530, Mohammed Shafi Shajakhan wrote:
> From: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
> 
> Return value is incorrect for btcoex and peer stats debugfs
> 'write' entries if the user provides a value that matches with
> the already available debugfs entry, this results in the debugfs
> entry getting stuck and the operation has to be terminated manually.
> Fix this by returning the appropriate return 'count' as we do it for
> other debugfs entries like pktlog etc

Not your code, but some of the xor uses are odd at best.

> diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
[]
> @@ -2122,7 +2122,7 @@ static ssize_t ath10k_write_btcoex(struct file *file,
>  	struct ath10k *ar = file->private_data;
>  	char buf[32];
>  	size_t buf_size;
> -	int ret = 0;
> +	int ret;
>  	bool val;
>  
>  	buf_size = min(count, (sizeof(buf) - 1));
> @@ -2142,8 +2142,10 @@ static ssize_t ath10k_write_btcoex(struct file *file,
>  		goto exit;
>  	}
>  
> -	if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags) ^ val))
> +	if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags) ^ val)) {

xor on an int and a bool.

> @@ -2189,7 +2191,7 @@ static ssize_t ath10k_write_peer_stats(struct file *file,
>  	struct ath10k *ar = file->private_data;
>  	char buf[32];
>  	size_t buf_size;
> -	int ret = 0;
> +	int ret;
>  	bool val;
>  
>  	buf_size = min(count, (sizeof(buf) - 1));
> @@ -2209,8 +2211,10 @@ static ssize_t ath10k_write_peer_stats(struct file *file,
>  		goto exit;
>  	}
>  
> -	if (!(test_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags) ^ val))
> +	if (!(test_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags) ^ val)) {

here too


  reply	other threads:[~2016-04-05 17:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05 15:28 [PATCH] ath10k: Fix return value for btcoex and peer stats debugfs Mohammed Shafi Shajakhan
2016-04-05 17:28 ` Joe Perches [this message]
2016-04-06 10:11   ` Mohammed Shafi Shajakhan
2016-04-19 15:46 ` Valo, Kalle
2016-04-19 15:57   ` Shajakhan, Mohammed Shafi (Mohammed Shafi)

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=1459877336.6715.6.camel@perches.com \
    --to=joe@perches.com \
    --cc=ath10k@lists.infradead.org \
    --cc=kvalo@codeaurora.org \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mohammed@codeaurora.org \
    --cc=mohammed@qti.qualcomm.com \
    --cc=yanbol@qca.qualcomm.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;
as well as URLs for NNTP newsgroup(s).