Re: [PATCH v2 1/2] serial: core: make static analyzer happy about locks

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

 



On Wed, Nov 16, 2016 at 08:06:32PM +0200, Andy Shevchenko wrote:
> Static analyzer can not see balanced locking if the lock is acquired and
> released conditionally.
> 
> drivers/tty/serial/serial_core.c:131:17: warning: context imbalance in 'uart_stop' - unexpected unlock
> include/linux/spinlock.h:362:9: warning: context imbalance in 'uart_start' - unexpected unlock
> include/linux/spinlock.h:362:9: warning: context imbalance in 'uart_put_char' - unexpected unlock
> include/linux/spinlock.h:362:9: warning: context imbalance in 'uart_write' - unexpected unlock
> include/linux/spinlock.h:362:9: warning: context imbalance in 'uart_write_room' - unexpected unlock
> include/linux/spinlock.h:362:9: warning: context imbalance in 'uart_chars_in_buffer' - unexpected unlock
> include/linux/spinlock.h:362:9: warning: context imbalance in 'uart_flush_buffer' - unexpected unlock
> 
> Get rid of macros and implement their functionality in place. This will also
> help to enable runtime PM in more clean way later.

Really?  Because now the code is harder to follow from a "what is this
doing" point of view as you have to duplicate logic in a number of
different places.

What happened to making these just static inline functions instead?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux