提交 372bd282 编写于 作者: J Julia Lawall 提交者: James Bottomley

[SCSI] lpfc: Move a dereference below a NULL test

In each case, if the NULL test is necessary, then the dereference should be
moved below the NULL test.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
type T;
expression E;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E
      when != i
  if (E == NULL) S
+ i = E->fld;
// </smpl>
Signed-off-by: NJulia Lawall <julia@diku.dk>
Acked-by: NJames Smart <James.Smart@Emulex.Com>
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
上级 b99b4c67
......@@ -1795,12 +1795,13 @@ lpfc_block_mgmt_io(struct lpfc_hba * phba)
int
lpfc_online(struct lpfc_hba *phba)
{
struct lpfc_vport *vport = phba->pport;
struct lpfc_vport *vport;
struct lpfc_vport **vports;
int i;
if (!phba)
return 0;
vport = phba->pport;
if (!(vport->fc_flag & FC_OFFLINE_MODE))
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册