Re: [PATCH v7 8/9] snic:Add event tracing to capture IO events.

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

 



On Fri, 2015-05-29 at 01:04 -0700, Narsimhulu Musini wrote:
> +#define SNIC_TRC(_hno, _tag, d1, d2, d3, d4, d5)	\
> +	do {						\
> +		if (unlikely(snic_log_level & 0x2))	\
> +			SNIC_DBG("SnicTrace: %s %2u %2u %llx %llx %llx %llx %llx", \
> +				 (char *)__func__,	\
> +				 (u16)(_hno),		\
> +				 (u32)(_tag),		\
> +				 (u64)(d1),		\
> +				 (u64)(d2),		\
> +				 (u64)(d3),		\
> +				 (u64)(d4),		\
> +				 (u64)(d5));		\
> +	} while (0);

This one is also a fault: do { } while(0) is added to a set of
statements to make it appear to the compiler as a unit.  If you add an
extra semicolon at the end you get a hidden double semicolon which can
lead to unexpected problems.  For instance

for (SNIC_TRC(...), i=1; ...)

will cause an error.

I fixed this up too.

James


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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux