Re: [PATCH] tty: serial_core: Using a better pattern with WARN_ON()

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

 



On Wed, Dec 07, 2016 at 11:18:23AM +0530, Srikant Ritolia wrote:
> Instead of using:
> if (cond){
> 	WARN_ON(1);
> 	do_stuff();
> }
> 
> Use a better pattern with WARN_ON() placed in if condition.
> 
> if (WARN_ON(cond))
> 	do_stuff();

Why is it "better"?

And you have a coding style mistake in your example above :)

sorry, this doesn't seem to be needed,

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