Re: [PATCH BlueZ 4/5] plugins/sixaxis: add a get_leds_data() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 9 May 2014 15:22:32 +0300
Johan Hedberg <johan.hedberg@xxxxxxxxx> wrote:

> Hi Antonio,
> 
[...] 
> >  
> > -	if (cond & (G_IO_HUP | G_IO_ERR | G_IO_NVAL))
> > +	if (data == NULL)
> >  		return FALSE;
> >  
> > -	DBG("number %d", number);
> > +	if (cond & (G_IO_HUP | G_IO_ERR | G_IO_NVAL))
> > +		goto out;
> >  
> >  	fd = g_io_channel_unix_get_fd(channel);
> >  
> > -	if (calc_leds_bitmap(number, &bitmap))
> > -		set_leds_hidraw(fd, bitmap);
> > +	set_leds_hidraw(fd, data->bitmap);
> > +
> > +out:
> > +	for (i = 0; i < 4; i++)
> > +		free(data->syspaths[i]);
> > +	free(data);
> >  
> >  	return FALSE;
> >  }
> 
> I don't see you using the "int ret" anywhere in this function. Even if
> you do end up using it later for returning something I suppose it should
> be a boolean type and not int. However even then the variable should be
> introduced in the patch that actually makes use of it. If you build test
> each patch individually with --enable-maintainer-mode the compiler
> should warn about unused variables (amongst many other things) for you.
>

Thanks Johan, I forgot about --enable-maintainer-mode.

I'll use it for the v2.

Ciao ciao,
   Antonio

-- 
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux