Re: [PATCH] scsi_mod: Add a new parameter to scsi_mod to control storage logging

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

 



On 4/1/21 6:09 PM, Laurence Oberman wrote:
>  #define sd_printk(prefix, sdsk, fmt, a...)				\
> -        (sdsk)->disk ?							\
> -	      sdev_prefix_printk(prefix, (sdsk)->device,		\
> +	do {								\
> +		if (!storage_quiet_discovery)				\
> +		 (sdsk)->disk ?						\
> +			sdev_prefix_printk(prefix, (sdsk)->device,	\
>  				 (sdsk)->disk->disk_name, fmt, ##a) :	\
> -	      sdev_printk(prefix, (sdsk)->device, fmt, ##a)
> +			sdev_printk(prefix, (sdsk)->device, fmt, ##a);	\
> +	} while (0)

The indentation inside the above macro looks odd to me. I guess that you
want to avoid deep indentation? Consider using if (...) break; instead
to reduce the indentation level. Additionally, please change the ternary
operator into an if-condition since the result of the ternary operator
is not used. How about rewriting the above macro as follows?

do {
	if (storage_quiet_discovery)
		break;
	if ((sdk)->disk)
		[ ... ]
	else
		[ ... ]
} while (0)

Thanks,

Bart.



[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