Re: [PATCH 03/32] elx: libefc_sli: Data structures and defines for mbox commands

Steffen Maier
2019-10-25T12:20:26Z

On 10/25/19 1:19 PM, Daniel Wagner wrote:
> On Wed, Oct 23, 2019 at 02:55:28PM -0700, James Smart wrote:
>> This patch continues the libefc_sli SLI-4 library population.
>>
>> This patch adds definitions for SLI-4 mailbox commands
>> and responses.
>>
>> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com>
>> Signed-off-by: James Smart <jsmart2021@gmail.com>
>> ---
>> drivers/scsi/elx/libefc_sli/sli4.h | 1996 ++++++++++++++++++++++++++++++++++++
>> 1 file changed, 1996 insertions(+)

>> +#define SLI_ROUND_PAGE(b) (((b) + SLI_SUB_PAGE_MASK) & ~SLI_SUB_PAGE_MASK)

>> +/**
>> + * @brief COMMON_GET_SLI4_PARAMETERS
>> + */
>> +
>> +#define GET_Q_CNT_METHOD(val)\
>> + ((val & RSP_GET_PARAM_Q_CNT_MTHD_MASK)\
>> + >> RSP_GET_PARAM_Q_CNT_MTHD_SHFT)
>> +#define GET_Q_CREATE_VERSION(val)\
>> + ((val & RSP_GET_PARAM_QV_MASK)\
>> + >> RSP_GET_PARAM_QV_SHIFT)
>
> This time there is no space in front of '\'. Does the expresssion not
> fit on one line? Would be easier to read:
>
> #define GET_Q_CREATE_VERSION(val) \
> ((val & RSP_GET_PARAM_QV_MASK) >> RSP_GET_PARAM_QV_SHIFT)

Protect the macro argument in the expansion with parentheses to prevent
unintended operator precedence during evaluation?
As with (b) of SLI_ROUND_PAGE(b) above.

(((val) & ... ))

--
Mit freundlichen Gruessen / Kind regards
Steffen Maier

Linux on IBM Z Development

https://www.ibm.com/privacy/us/en/
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Matthias Hartmann
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294