From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id A895C594B for ; Fri, 8 May 2015 05:21:49 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 07 May 2015 20:21:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,387,1427785200"; d="scan'208";a="691752257" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by orsmga001.jf.intel.com with ESMTP; 07 May 2015 20:21:48 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX107.gar.corp.intel.com (10.221.44.105) with Microsoft SMTP Server (TLS) id 14.3.224.2; Fri, 8 May 2015 11:20:28 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.162]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.69]) with mapi id 14.03.0224.002; Fri, 8 May 2015 11:20:26 +0800 From: "Wu, Jingjing" To: "Zhang, Helin" , "dev@dpdk.org" Thread-Topic: [PATCH v2 04/33] i40e/base: rename 'err' to 'perrno' Thread-Index: AQHQg1bpfn2182h76UyNDl9uBU0uN51xdSCA Date: Fri, 8 May 2015 03:20:27 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F8C182FB@SHSMSX104.ccr.corp.intel.com> References: <1429518150-28098-1-git-send-email-helin.zhang@intel.com> <1430406219-23901-1-git-send-email-helin.zhang@intel.com> <1430406219-23901-5-git-send-email-helin.zhang@intel.com> In-Reply-To: <1430406219-23901-5-git-send-email-helin.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "Kenguva, Monica" , "Murray, Steven J" , "Nelson, Shannon" Subject: Re: [dpdk-dev] [PATCH v2 04/33] i40e/base: rename 'err' to 'perrno' X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 03:21:50 -0000 Acked-by: Jingjing Wu > -----Original Message----- > From: Zhang, Helin > Sent: Thursday, April 30, 2015 11:03 PM > To: dev@dpdk.org > Cc: Cao, Min; Xu, Qian Q; Wu, Jingjing; Liu, Jijiang; Kenguva, Monica; Pa= tel, > Rashmin N; Murray, Steven J; Nelson, Shannon; Zhang, Helin > Subject: [PATCH v2 04/33] i40e/base: rename 'err' to 'perrno' >=20 > To be consistent with the original base driver, the variable name of 'err= ' > should be renamed to 'perrno'. >=20 > Signed-off-by: Helin Zhang > --- > lib/librte_pmd_i40e/i40e/i40e_nvm.c | 118 ++++++++++++++++++------------ > ------ > 1 file changed, 59 insertions(+), 59 deletions(-) >=20 > diff --git a/lib/librte_pmd_i40e/i40e/i40e_nvm.c > b/lib/librte_pmd_i40e/i40e/i40e_nvm.c > index 73b8997..2b70508 100644 > --- a/lib/librte_pmd_i40e/i40e/i40e_nvm.c > +++ b/lib/librte_pmd_i40e/i40e/i40e_nvm.c > @@ -481,25 +481,25 @@ i40e_validate_nvm_checksum_exit: >=20 > STATIC enum i40e_status_code i40e_nvmupd_state_init(struct i40e_hw > *hw, > struct i40e_nvm_access > *cmd, > - u8 *bytes, int *err); > + u8 *bytes, int *perrno); > STATIC enum i40e_status_code i40e_nvmupd_state_reading(struct i40e_hw > *hw, > struct i40e_nvm_access > *cmd, > - u8 *bytes, int *err); > + u8 *bytes, int *perrno); > STATIC enum i40e_status_code i40e_nvmupd_state_writing(struct i40e_hw > *hw, > struct i40e_nvm_access > *cmd, > - u8 *bytes, int *err); > + u8 *bytes, int *perrno); > STATIC enum i40e_nvmupd_cmd i40e_nvmupd_validate_command(struct > i40e_hw *hw, > struct i40e_nvm_access > *cmd, > - int *err); > + int *perrno); > STATIC enum i40e_status_code i40e_nvmupd_nvm_erase(struct i40e_hw > *hw, > struct i40e_nvm_access > *cmd, > - int *err); > + int *perrno); > STATIC enum i40e_status_code i40e_nvmupd_nvm_write(struct i40e_hw > *hw, > struct i40e_nvm_access > *cmd, > - u8 *bytes, int *err); > + u8 *bytes, int *perrno); > STATIC enum i40e_status_code i40e_nvmupd_nvm_read(struct i40e_hw > *hw, > struct i40e_nvm_access > *cmd, > - u8 *bytes, int *err); > + u8 *bytes, int *perrno); > STATIC inline u8 i40e_nvmupd_get_module(u32 val) { > return (u8)(val & I40E_NVM_MOD_PNT_MASK); @@ -514,38 > +514,38 @@ STATIC inline u8 i40e_nvmupd_get_transaction(u32 val) > * @hw: pointer to hardware structure > * @cmd: pointer to nvm update command > * @bytes: pointer to the data buffer > - * @err: pointer to return error code > + * @perrno: pointer to return error code > * > * Dispatches command depending on what update state is current > **/ > enum i40e_status_code i40e_nvmupd_command(struct i40e_hw *hw, > struct i40e_nvm_access *cmd, > - u8 *bytes, int *err) > + u8 *bytes, int *perrno) > { > enum i40e_status_code status; >=20 > DEBUGFUNC("i40e_nvmupd_command"); >=20 > /* assume success */ > - *err =3D 0; > + *perrno =3D 0; >=20 > switch (hw->nvmupd_state) { > case I40E_NVMUPD_STATE_INIT: > - status =3D i40e_nvmupd_state_init(hw, cmd, bytes, err); > + status =3D i40e_nvmupd_state_init(hw, cmd, bytes, perrno); > break; >=20 > case I40E_NVMUPD_STATE_READING: > - status =3D i40e_nvmupd_state_reading(hw, cmd, bytes, err); > + status =3D i40e_nvmupd_state_reading(hw, cmd, bytes, > perrno); > break; >=20 > case I40E_NVMUPD_STATE_WRITING: > - status =3D i40e_nvmupd_state_writing(hw, cmd, bytes, err); > + status =3D i40e_nvmupd_state_writing(hw, cmd, bytes, perrno); > break; >=20 > default: > /* invalid state, should never happen */ > status =3D I40E_NOT_SUPPORTED; > - *err =3D -ESRCH; > + *perrno =3D -ESRCH; > break; > } > return status; > @@ -556,29 +556,29 @@ enum i40e_status_code > i40e_nvmupd_command(struct i40e_hw *hw, > * @hw: pointer to hardware structure > * @cmd: pointer to nvm update command buffer > * @bytes: pointer to the data buffer > - * @err: pointer to return error code > + * @perrno: pointer to return error code > * > * Process legitimate commands of the Init state and conditionally set n= ext > * state. Reject all other commands. > **/ > STATIC enum i40e_status_code i40e_nvmupd_state_init(struct i40e_hw > *hw, > struct i40e_nvm_access > *cmd, > - u8 *bytes, int *err) > + u8 *bytes, int *perrno) > { > enum i40e_status_code status =3D I40E_SUCCESS; > enum i40e_nvmupd_cmd upd_cmd; >=20 > DEBUGFUNC("i40e_nvmupd_state_init"); >=20 > - upd_cmd =3D i40e_nvmupd_validate_command(hw, cmd, err); > + upd_cmd =3D i40e_nvmupd_validate_command(hw, cmd, perrno); >=20 > switch (upd_cmd) { > case I40E_NVMUPD_READ_SA: > status =3D i40e_acquire_nvm(hw, I40E_RESOURCE_READ); > if (status) { > - *err =3D i40e_aq_rc_to_posix(hw->aq.asq_last_status); > + *perrno =3D i40e_aq_rc_to_posix(hw- > >aq.asq_last_status); > } else { > - status =3D i40e_nvmupd_nvm_read(hw, cmd, bytes, > err); > + status =3D i40e_nvmupd_nvm_read(hw, cmd, bytes, > perrno); > i40e_release_nvm(hw); > } > break; > @@ -586,9 +586,9 @@ STATIC enum i40e_status_code > i40e_nvmupd_state_init(struct i40e_hw *hw, > case I40E_NVMUPD_READ_SNT: > status =3D i40e_acquire_nvm(hw, I40E_RESOURCE_READ); > if (status) { > - *err =3D i40e_aq_rc_to_posix(hw->aq.asq_last_status); > + *perrno =3D i40e_aq_rc_to_posix(hw- > >aq.asq_last_status); > } else { > - status =3D i40e_nvmupd_nvm_read(hw, cmd, bytes, > err); > + status =3D i40e_nvmupd_nvm_read(hw, cmd, bytes, > perrno); > hw->nvmupd_state =3D > I40E_NVMUPD_STATE_READING; > } > break; > @@ -596,9 +596,9 @@ STATIC enum i40e_status_code > i40e_nvmupd_state_init(struct i40e_hw *hw, > case I40E_NVMUPD_WRITE_ERA: > status =3D i40e_acquire_nvm(hw, I40E_RESOURCE_WRITE); > if (status) { > - *err =3D i40e_aq_rc_to_posix(hw->aq.asq_last_status); > + *perrno =3D i40e_aq_rc_to_posix(hw- > >aq.asq_last_status); > } else { > - status =3D i40e_nvmupd_nvm_erase(hw, cmd, err); > + status =3D i40e_nvmupd_nvm_erase(hw, cmd, perrno); > if (status) > i40e_release_nvm(hw); > else > @@ -609,9 +609,9 @@ STATIC enum i40e_status_code > i40e_nvmupd_state_init(struct i40e_hw *hw, > case I40E_NVMUPD_WRITE_SA: > status =3D i40e_acquire_nvm(hw, I40E_RESOURCE_WRITE); > if (status) { > - *err =3D i40e_aq_rc_to_posix(hw->aq.asq_last_status); > + *perrno =3D i40e_aq_rc_to_posix(hw- > >aq.asq_last_status); > } else { > - status =3D i40e_nvmupd_nvm_write(hw, cmd, bytes, > err); > + status =3D i40e_nvmupd_nvm_write(hw, cmd, bytes, > perrno); > if (status) > i40e_release_nvm(hw); > else > @@ -622,9 +622,9 @@ STATIC enum i40e_status_code > i40e_nvmupd_state_init(struct i40e_hw *hw, > case I40E_NVMUPD_WRITE_SNT: > status =3D i40e_acquire_nvm(hw, I40E_RESOURCE_WRITE); > if (status) { > - *err =3D i40e_aq_rc_to_posix(hw->aq.asq_last_status); > + *perrno =3D i40e_aq_rc_to_posix(hw- > >aq.asq_last_status); > } else { > - status =3D i40e_nvmupd_nvm_write(hw, cmd, bytes, > err); > + status =3D i40e_nvmupd_nvm_write(hw, cmd, bytes, > perrno); > hw->nvmupd_state =3D > I40E_NVMUPD_STATE_WRITING; > } > break; > @@ -632,11 +632,11 @@ STATIC enum i40e_status_code > i40e_nvmupd_state_init(struct i40e_hw *hw, > case I40E_NVMUPD_CSUM_SA: > status =3D i40e_acquire_nvm(hw, I40E_RESOURCE_WRITE); > if (status) { > - *err =3D i40e_aq_rc_to_posix(hw->aq.asq_last_status); > + *perrno =3D i40e_aq_rc_to_posix(hw- > >aq.asq_last_status); > } else { > status =3D i40e_update_nvm_checksum(hw); > if (status) { > - *err =3D hw->aq.asq_last_status ? > + *perrno =3D hw->aq.asq_last_status ? > i40e_aq_rc_to_posix(hw- > >aq.asq_last_status) : > -EIO; > i40e_release_nvm(hw); > @@ -648,7 +648,7 @@ STATIC enum i40e_status_code > i40e_nvmupd_state_init(struct i40e_hw *hw, >=20 > default: > status =3D I40E_ERR_NVM; > - *err =3D -ESRCH; > + *perrno =3D -ESRCH; > break; > } > return status; > @@ -659,37 +659,37 @@ STATIC enum i40e_status_code > i40e_nvmupd_state_init(struct i40e_hw *hw, > * @hw: pointer to hardware structure > * @cmd: pointer to nvm update command buffer > * @bytes: pointer to the data buffer > - * @err: pointer to return error code > + * @perrno: pointer to return error code > * > * NVM ownership is already held. Process legitimate commands and set > any > * change in state; reject all other commands. > **/ > STATIC enum i40e_status_code i40e_nvmupd_state_reading(struct i40e_hw > *hw, > struct i40e_nvm_access > *cmd, > - u8 *bytes, int *err) > + u8 *bytes, int *perrno) > { > enum i40e_status_code status; > enum i40e_nvmupd_cmd upd_cmd; >=20 > DEBUGFUNC("i40e_nvmupd_state_reading"); >=20 > - upd_cmd =3D i40e_nvmupd_validate_command(hw, cmd, err); > + upd_cmd =3D i40e_nvmupd_validate_command(hw, cmd, perrno); >=20 > switch (upd_cmd) { > case I40E_NVMUPD_READ_SA: > case I40E_NVMUPD_READ_CON: > - status =3D i40e_nvmupd_nvm_read(hw, cmd, bytes, err); > + status =3D i40e_nvmupd_nvm_read(hw, cmd, bytes, perrno); > break; >=20 > case I40E_NVMUPD_READ_LCB: > - status =3D i40e_nvmupd_nvm_read(hw, cmd, bytes, err); > + status =3D i40e_nvmupd_nvm_read(hw, cmd, bytes, perrno); > i40e_release_nvm(hw); > hw->nvmupd_state =3D I40E_NVMUPD_STATE_INIT; > break; >=20 > default: > status =3D I40E_NOT_SUPPORTED; > - *err =3D -ESRCH; > + *perrno =3D -ESRCH; > break; > } > return status; > @@ -700,29 +700,29 @@ STATIC enum i40e_status_code > i40e_nvmupd_state_reading(struct i40e_hw *hw, > * @hw: pointer to hardware structure > * @cmd: pointer to nvm update command buffer > * @bytes: pointer to the data buffer > - * @err: pointer to return error code > + * @perrno: pointer to return error code > * > * NVM ownership is already held. Process legitimate commands and set > any > * change in state; reject all other commands > **/ > STATIC enum i40e_status_code i40e_nvmupd_state_writing(struct i40e_hw > *hw, > struct i40e_nvm_access > *cmd, > - u8 *bytes, int *err) > + u8 *bytes, int *perrno) > { > enum i40e_status_code status; > enum i40e_nvmupd_cmd upd_cmd; >=20 > DEBUGFUNC("i40e_nvmupd_state_writing"); >=20 > - upd_cmd =3D i40e_nvmupd_validate_command(hw, cmd, err); > + upd_cmd =3D i40e_nvmupd_validate_command(hw, cmd, perrno); >=20 > switch (upd_cmd) { > case I40E_NVMUPD_WRITE_CON: > - status =3D i40e_nvmupd_nvm_write(hw, cmd, bytes, err); > + status =3D i40e_nvmupd_nvm_write(hw, cmd, bytes, perrno); > break; >=20 > case I40E_NVMUPD_WRITE_LCB: > - status =3D i40e_nvmupd_nvm_write(hw, cmd, bytes, err); > + status =3D i40e_nvmupd_nvm_write(hw, cmd, bytes, perrno); > if (!status) { > hw->aq.nvm_release_on_done =3D true; > hw->nvmupd_state =3D I40E_NVMUPD_STATE_INIT; > @@ -732,7 +732,7 @@ STATIC enum i40e_status_code > i40e_nvmupd_state_writing(struct i40e_hw *hw, > case I40E_NVMUPD_CSUM_CON: > status =3D i40e_update_nvm_checksum(hw); > if (status) > - *err =3D hw->aq.asq_last_status ? > + *perrno =3D hw->aq.asq_last_status ? > i40e_aq_rc_to_posix(hw- > >aq.asq_last_status) : > -EIO; > break; > @@ -740,7 +740,7 @@ STATIC enum i40e_status_code > i40e_nvmupd_state_writing(struct i40e_hw *hw, > case I40E_NVMUPD_CSUM_LCB: > status =3D i40e_update_nvm_checksum(hw); > if (status) { > - *err =3D hw->aq.asq_last_status ? > + *perrno =3D hw->aq.asq_last_status ? > i40e_aq_rc_to_posix(hw- > >aq.asq_last_status) : > -EIO; > } else { > @@ -751,7 +751,7 @@ STATIC enum i40e_status_code > i40e_nvmupd_state_writing(struct i40e_hw *hw, >=20 > default: > status =3D I40E_NOT_SUPPORTED; > - *err =3D -ESRCH; > + *perrno =3D -ESRCH; > break; > } > return status; > @@ -761,13 +761,13 @@ STATIC enum i40e_status_code > i40e_nvmupd_state_writing(struct i40e_hw *hw, > * i40e_nvmupd_validate_command - Validate given command > * @hw: pointer to hardware structure > * @cmd: pointer to nvm update command buffer > - * @err: pointer to return error code > + * @perrno: pointer to return error code > * > * Return one of the valid command types or I40E_NVMUPD_INVALID > **/ > STATIC enum i40e_nvmupd_cmd i40e_nvmupd_validate_command(struct > i40e_hw *hw, > struct i40e_nvm_access > *cmd, > - int *err) > + int *perrno) > { > enum i40e_nvmupd_cmd upd_cmd; > u8 transaction, module; > @@ -785,7 +785,7 @@ STATIC enum i40e_nvmupd_cmd > i40e_nvmupd_validate_command(struct i40e_hw *hw, > (cmd->data_size > I40E_NVMUPD_MAX_DATA)) { > DEBUGOUT1("i40e_nvmupd_validate_command > data_size %d\n", > cmd->data_size); > - *err =3D -EFAULT; > + *perrno =3D -EFAULT; > return I40E_NVMUPD_INVALID; > } >=20 > @@ -838,10 +838,10 @@ STATIC enum i40e_nvmupd_cmd > i40e_nvmupd_validate_command(struct i40e_hw *hw, > } >=20 > if (upd_cmd =3D=3D I40E_NVMUPD_INVALID) { > - *err =3D -EFAULT; > + *perrno =3D -EFAULT; > DEBUGOUT2( > - "i40e_nvmupd_validate_command returns %d > err: %d\n", > - upd_cmd, *err); > + "i40e_nvmupd_validate_command returns %d > perrno: %d\n", > + upd_cmd, *perrno); > } > return upd_cmd; > } > @@ -851,13 +851,13 @@ STATIC enum i40e_nvmupd_cmd > i40e_nvmupd_validate_command(struct i40e_hw *hw, > * @hw: pointer to hardware structure > * @cmd: pointer to nvm update command buffer > * @bytes: pointer to the data buffer > - * @err: pointer to return error code > + * @perrno: pointer to return error code > * > * cmd structure contains identifiers and data buffer > **/ > STATIC enum i40e_status_code i40e_nvmupd_nvm_read(struct i40e_hw > *hw, > struct i40e_nvm_access > *cmd, > - u8 *bytes, int *err) > + u8 *bytes, int *perrno) > { > enum i40e_status_code status; > u8 module, transaction; > @@ -873,7 +873,7 @@ STATIC enum i40e_status_code > i40e_nvmupd_nvm_read(struct i40e_hw *hw, > bytes, last, NULL); > DEBUGOUT1("i40e_nvmupd_nvm_read status %d\n", status); > if (status !=3D I40E_SUCCESS) > - *err =3D i40e_aq_rc_to_posix(hw->aq.asq_last_status); > + *perrno =3D i40e_aq_rc_to_posix(hw->aq.asq_last_status); >=20 > return status; > } > @@ -882,13 +882,13 @@ STATIC enum i40e_status_code > i40e_nvmupd_nvm_read(struct i40e_hw *hw, > * i40e_nvmupd_nvm_erase - Erase an NVM module > * @hw: pointer to hardware structure > * @cmd: pointer to nvm update command buffer > - * @err: pointer to return error code > + * @perrno: pointer to return error code > * > * module, offset, data_size and data are in cmd structure > **/ > STATIC enum i40e_status_code i40e_nvmupd_nvm_erase(struct i40e_hw > *hw, > struct i40e_nvm_access > *cmd, > - int *err) > + int *perrno) > { > enum i40e_status_code status =3D I40E_SUCCESS; > u8 module, transaction; > @@ -903,7 +903,7 @@ STATIC enum i40e_status_code > i40e_nvmupd_nvm_erase(struct i40e_hw *hw, > last, NULL); > DEBUGOUT1("i40e_nvmupd_nvm_erase status %d\n", status); > if (status !=3D I40E_SUCCESS) > - *err =3D i40e_aq_rc_to_posix(hw->aq.asq_last_status); > + *perrno =3D i40e_aq_rc_to_posix(hw->aq.asq_last_status); >=20 > return status; > } > @@ -913,13 +913,13 @@ STATIC enum i40e_status_code > i40e_nvmupd_nvm_erase(struct i40e_hw *hw, > * @hw: pointer to hardware structure > * @cmd: pointer to nvm update command buffer > * @bytes: pointer to the data buffer > - * @err: pointer to return error code > + * @perrno: pointer to return error code > * > * module, offset, data_size and data are in cmd structure > **/ > STATIC enum i40e_status_code i40e_nvmupd_nvm_write(struct i40e_hw > *hw, > struct i40e_nvm_access > *cmd, > - u8 *bytes, int *err) > + u8 *bytes, int *perrno) > { > enum i40e_status_code status =3D I40E_SUCCESS; > u8 module, transaction; > @@ -934,7 +934,7 @@ STATIC enum i40e_status_code > i40e_nvmupd_nvm_write(struct i40e_hw *hw, > (u16)cmd->data_size, bytes, last, NULL); > DEBUGOUT1("i40e_nvmupd_nvm_write status %d\n", status); > if (status !=3D I40E_SUCCESS) > - *err =3D i40e_aq_rc_to_posix(hw->aq.asq_last_status); > + *perrno =3D i40e_aq_rc_to_posix(hw->aq.asq_last_status); >=20 > return status; > } > -- > 1.8.1.4