>>> Mike Christie <[email protected]> schrieb am 11.01.2011 um 21:24 in Nachricht <[email protected]>: > On 01/07/2011 04:45 PM, [email protected] wrote: > > [PATCH 1/2] cxgbi: set ulpmode only if digest is on > > > > From: Karen Xie<[email protected]> > > > > There is need to set ulpmode on the tx skbs if no digest is enabled. > > > > Signed-off-by: Karen Xie<[email protected]> > > --- > > drivers/scsi/cxgbi/libcxgbi.c | 17 ++++++++++------- > > 1 files changed, 10 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c > > index be56617..17dcada 100644 > > --- a/drivers/scsi/cxgbi/libcxgbi.c > > +++ b/drivers/scsi/cxgbi/libcxgbi.c > > @@ -1908,13 +1908,16 @@ EXPORT_SYMBOL_GPL(cxgbi_conn_alloc_pdu); > > > > static inline void tx_skb_setmode(struct sk_buff *skb, int hcrc, int > dcrc) > > { > > - u8 submode = 0; > > - > > - if (hcrc) > > - submode |= 1; > > - if (dcrc) > > - submode |= 2; > > - cxgbi_skcb_ulp_mode(skb) = (ULP2_MODE_ISCSI<< 4) | submode; > > + if (hcrc || dcrc) { > > + u8 submode = 0; > > + > > + if (hcrc) > > + submode |= 1; > > + if (dcrc) > > + submode |= 2; > > + cxgbi_skcb_ulp_mode(skb) = (ULP2_MODE_ISCSI<< 4) | submode; > > + } else > > + cxgbi_skcb_ulp_mode(skb) = 0;
Well, wouldn't the code be much clearer (unless further refinements are already on the way) like this:? if (hcrc) cxgbi_skcb_ulp_mode(skb) = (ULP2_MODE_ISCSI << 4) | 1; else if (dcrc) cxgbi_skcb_ulp_mode(skb) = (ULP2_MODE_ISCSI << 4) | 2; else cxgbi_skcb_ulp_mode(skb) = 0; (Maybe the compiler optimizes the code like that anyway) Regards, Ulrich > > } > > > > int cxgbi_conn_init_pdu(struct iscsi_task *task, unsigned int offset, > > > > Ok. > > Reviewed-by: Mike Christie <[email protected]> -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/open-iscsi?hl=en.
