Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libfc: Debug code fixes

The second argument of fc_lport_error() may be a valid frame pointer.
Hence only print it as an error code if it really is an error code.

Debug statements must end in a newline. Add one where it is missing.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>

authored by

Bart Van Assche and committed by
Robert Love
b20d9bfd c1d45424

+5 -5
+4 -4
drivers/scsi/libfc/fc_exch.c
··· 1659 1659 break; 1660 1660 default: 1661 1661 if (ep) 1662 - FC_EXCH_DBG(ep, "BLS rctl %x - %s received", 1662 + FC_EXCH_DBG(ep, "BLS rctl %x - %s received\n", 1663 1663 fh->fh_r_ctl, 1664 1664 fc_exch_rctl_name(fh->fh_r_ctl)); 1665 1665 break; ··· 1953 1953 1954 1954 switch (op) { 1955 1955 case ELS_LS_RJT: 1956 - FC_EXCH_DBG(aborted_ep, "LS_RJT for RRQ"); 1956 + FC_EXCH_DBG(aborted_ep, "LS_RJT for RRQ\n"); 1957 1957 /* fall through */ 1958 1958 case ELS_LS_ACC: 1959 1959 goto cleanup; 1960 1960 default: 1961 - FC_EXCH_DBG(aborted_ep, "unexpected response op %x " 1962 - "for RRQ", op); 1961 + FC_EXCH_DBG(aborted_ep, "unexpected response op %x for RRQ\n", 1962 + op); 1963 1963 return; 1964 1964 } 1965 1965
+1 -1
drivers/scsi/libfc/fc_lport.c
··· 1088 1088 { 1089 1089 unsigned long delay = 0; 1090 1090 FC_LPORT_DBG(lport, "Error %ld in state %s, retries %d\n", 1091 - PTR_ERR(fp), fc_lport_state(lport), 1091 + IS_ERR(fp) ? -PTR_ERR(fp) : 0, fc_lport_state(lport), 1092 1092 lport->retry_count); 1093 1093 1094 1094 if (PTR_ERR(fp) == -FC_EX_CLOSED)