On 5/24/19 11:47 AM, Douglas Gilbert wrote:
> Replace SCSI_LOG_TIMEOUT macros with SG_LOG macros across the driver.
> The definition of SG_LOG calls SCSI_LOG_TIMEOUT if scsi_device
> pointer is non-zero, calls pr_info otherwise. Prints the thread id
> if current is non-zero, -1 otherwise.

What makes you think that logging the thread ID is useful?

What is sg-specific about the SG_LOG() macro? Why to restrict the
introduction of this macro to the sg code?

Do we really need the SG_LOG() macro?

> +#if IS_ENABLED(CONFIG_SCSI_LOGGING)
> +#define SG_LOG(depth, sdp, fmt, a...)                                        
> \
> +     do {                                                            \
> +             char _b[160];                                           \

No new hardcoded buffer size limits please. Such size limits are
typically either too small or too big.

> +             int _tid = (current ? current->pid : -1);               \

Is current ever NULL?

Is this macro ever invoked from interrupt context? I'm asking because I
think in interrupt context 'current' refers to the context that has been
interrupted instead of the interrupt context.

Thanks,

Bart.

Reply via email to