linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/seq2bseq : Fix the same expression issue in if condition
@ 2014-09-10  6:42 gowtham babu
  2014-09-12 16:57 ` Johan Hedberg
  0 siblings, 1 reply; 4+ messages in thread
From: gowtham babu @ 2014-09-10  6:42 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, gowtham babu

Fix the usage of same expression on both sides of '||' in if

Below are the list of similar patches under 'tools' which are not yet reviewed

1) tools/csr_usb : Fix Resource leak: file
2) tools/hciattach : Fix syntax error
3) tools/btsnoop : Fix variable reassigning issue
---
 tools/seq2bseq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/seq2bseq.c b/tools/seq2bseq.c
index 7657a57..521d20e 100644
--- a/tools/seq2bseq.c
+++ b/tools/seq2bseq.c
@@ -40,7 +40,7 @@ static int convert_line(int fd, const char *line)
 	char str[3];
 	unsigned char val;
 
-	if (line[0] == '*' || line[0] == '\r' || line[0] == '\r')
+	if (line[0] == '*' || line[0] == '\r')
 		return 0;
 
 	while (1) {
-- 
1.9.1


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

* Re: [PATCH] tools/seq2bseq : Fix the same expression issue in if condition
  2014-09-10  6:42 [PATCH] tools/seq2bseq : Fix the same expression issue in if condition gowtham babu
@ 2014-09-12 16:57 ` Johan Hedberg
  2014-09-12 17:05   ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Hedberg @ 2014-09-12 16:57 UTC (permalink / raw)
  To: gowtham babu; +Cc: linux-bluetooth, d.kasatkin, bharat.panda, cpgs

Hi,

On Wed, Sep 10, 2014, gowtham babu wrote:
> Below are the list of similar patches under 'tools' which are not yet reviewed
> 
> 1) tools/csr_usb : Fix Resource leak: file
> 2) tools/hciattach : Fix syntax error
> 3) tools/btsnoop : Fix variable reassigning issue

This kind of stuff does not belong in a commit message.

> diff --git a/tools/seq2bseq.c b/tools/seq2bseq.c
> index 7657a57..521d20e 100644
> --- a/tools/seq2bseq.c
> +++ b/tools/seq2bseq.c
> @@ -40,7 +40,7 @@ static int convert_line(int fd, const char *line)
>  	char str[3];
>  	unsigned char val;
>  
> -	if (line[0] == '*' || line[0] == '\r' || line[0] == '\r')
> +	if (line[0] == '*' || line[0] == '\r')
>  		return 0;
>  
>  	while (1) {

Are you sure the code wasn't intending to check for '\n'?

Johan

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

* Re: [PATCH] tools/seq2bseq : Fix the same expression issue in if condition
  2014-09-12 16:57 ` Johan Hedberg
@ 2014-09-12 17:05   ` Marcel Holtmann
  2014-09-15  6:14     ` Gowtham Anandha Babu
  0 siblings, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2014-09-12 17:05 UTC (permalink / raw)
  To: Johan Hedberg
  Cc: gowtham babu, linux-bluetooth, d.kasatkin, bharat.panda, cpgs

Hi Johan,

>> Below are the list of similar patches under 'tools' which are not yet reviewed
>> 
>> 1) tools/csr_usb : Fix Resource leak: file
>> 2) tools/hciattach : Fix syntax error
>> 3) tools/btsnoop : Fix variable reassigning issue
> 
> This kind of stuff does not belong in a commit message.
> 
>> diff --git a/tools/seq2bseq.c b/tools/seq2bseq.c
>> index 7657a57..521d20e 100644
>> --- a/tools/seq2bseq.c
>> +++ b/tools/seq2bseq.c
>> @@ -40,7 +40,7 @@ static int convert_line(int fd, const char *line)
>> 	char str[3];
>> 	unsigned char val;
>> 
>> -	if (line[0] == '*' || line[0] == '\r' || line[0] == '\r')
>> +	if (line[0] == '*' || line[0] == '\r')
>> 		return 0;
>> 
>> 	while (1) {
> 
> Are you sure the code wasn't intending to check for '\n'?

yes, it was intended to check for \r and \n. This is my mistake here.

Regards

Marcel


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

* RE: [PATCH] tools/seq2bseq : Fix the same expression issue in if condition
  2014-09-12 17:05   ` Marcel Holtmann
@ 2014-09-15  6:14     ` Gowtham Anandha Babu
  0 siblings, 0 replies; 4+ messages in thread
From: Gowtham Anandha Babu @ 2014-09-15  6:14 UTC (permalink / raw)
  To: 'Marcel Holtmann', 'Johan Hedberg'
  Cc: linux-bluetooth, d.kasatkin, bharat.panda, cpgs

Hi ,

> -----Original Message-----
> From: Marcel Holtmann [mailto:marcel@holtmann.org]
> Sent: Friday, September 12, 2014 10:35 PM
> To: Johan Hedberg
> Cc: gowtham babu; linux-bluetooth@vger.kernel.org;
> d.kasatkin@samsung.com; bharat.panda@samsung.com;
> cpgs@samsung.com
> Subject: Re: [PATCH] tools/seq2bseq : Fix the same expression issue in if
> condition
> 
> Hi Johan,
> 
> >> Below are the list of similar patches under 'tools' which are not yet
> >> reviewed
> >>
> >> 1) tools/csr_usb : Fix Resource leak: file
> >> 2) tools/hciattach : Fix syntax error
> >> 3) tools/btsnoop : Fix variable reassigning issue
> >
> > This kind of stuff does not belong in a commit message.
> >
> >> diff --git a/tools/seq2bseq.c b/tools/seq2bseq.c index
> >> 7657a57..521d20e 100644
> >> --- a/tools/seq2bseq.c
> >> +++ b/tools/seq2bseq.c
> >> @@ -40,7 +40,7 @@ static int convert_line(int fd, const char *line)
> >> 	char str[3];
> >> 	unsigned char val;
> >>
> >> -	if (line[0] == '*' || line[0] == '\r' || line[0] == '\r')
> >> +	if (line[0] == '*' || line[0] == '\r')
> >> 		return 0;
> >>
> >> 	while (1) {
> >
> > Are you sure the code wasn't intending to check for '\n'?
> 
> yes, it was intended to check for \r and \n. This is my mistake here.
> 
> Regards
> 
> Marcel

I had fixed this and sent the revised patch. Please have a look at it. 

Regards,
Gowtham 


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

end of thread, other threads:[~2014-09-15  6:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-10  6:42 [PATCH] tools/seq2bseq : Fix the same expression issue in if condition gowtham babu
2014-09-12 16:57 ` Johan Hedberg
2014-09-12 17:05   ` Marcel Holtmann
2014-09-15  6:14     ` Gowtham Anandha Babu

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).