On Wed, Jul 09, 2014 at 03:17:56PM -0700, Adam Radford wrote:
> The following patch for megaraid_sas fixes the LD/VF affiliation policy 
> parsing
> code to account for LD targetId's and Hidden LD's (not yet affiliated with any
> Virtual Functions).  This also breaks megasas_get_ld_vf_affiliation() into 2
> separate functions:  megasas_get_ld_vf_affiliation_111() and
> megasas_get_ld_Vf_affiliation_12() to reduce indentation levels.
> 
> Signed-off-by: Adam Radford <aradf...@gmail.com>
> ---
>  drivers/scsi/megaraid/megaraid_sas.h      |   1 +
>  drivers/scsi/megaraid/megaraid_sas_base.c | 318 
> +++++++++++++++++++-----------
>  2 files changed, 208 insertions(+), 111 deletions(-)
> 
> diff --git a/drivers/scsi/megaraid/megaraid_sas.h 
> b/drivers/scsi/megaraid/megaraid_sas.h
> index 7d722fb..2e2fcb2 100644
> --- a/drivers/scsi/megaraid/megaraid_sas.h
> +++ b/drivers/scsi/megaraid/megaraid_sas.h
> @@ -1659,6 +1659,7 @@ struct MR_LD_VF_AFFILIATION {
>  /* Plasma 1.11 FW backward compatibility structures */
>  #define IOV_111_OFFSET 0x7CE
>  #define MAX_VIRTUAL_FUNCTIONS 8
> +#define MR_LD_ACCESS_HIDDEN 15
>  
>  struct IOV_111 {
>       u8 maxVFsSupported;
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
> b/drivers/scsi/megaraid/megaraid_sas_base.c
> index 112799b..b4c032c 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -1825,16 +1825,12 @@ void megasas_do_ocr(struct megasas_instance *instance)
>       process_fw_state_change_wq(&instance->work_init);
>  }
>  
> -/* This function will get the current SR-IOV LD/VF affiliation */
> -static int megasas_get_ld_vf_affiliation(struct megasas_instance *instance,
> -     int initial)
> +static int megasas_get_ld_vf_affiliation_111(struct megasas_instance 
> *instance,
> +                                         int initial)
>  {
>       struct megasas_cmd *cmd;
>       struct megasas_dcmd_frame *dcmd;
> -     struct MR_LD_VF_AFFILIATION *new_affiliation = NULL;
>       struct MR_LD_VF_AFFILIATION_111 *new_affiliation_111 = NULL;
> -     struct MR_LD_VF_MAP *newmap = NULL, *savedmap = NULL;
> -     dma_addr_t new_affiliation_h;
>       dma_addr_t new_affiliation_111_h;
>       int ld, retval = 0;
>       u8 thisVf;
> @@ -1842,15 +1838,15 @@ static int megasas_get_ld_vf_affiliation(struct 
> megasas_instance *instance,
>       cmd = megasas_get_cmd(instance);
>  
>       if (!cmd) {
> -             printk(KERN_DEBUG "megasas: megasas_get_ld_vf_"
> -                    "affiliation: Failed to get cmd for scsi%d.\n",
> +             printk(KERN_DEBUG "megasas: megasas_get_ld_vf_affiliation_111:"

You'd make your life easier if you just used __func__ to print the
function name.

I also think the initial variant should have their own set of functions,
but I'm not going to held this series over over these bits:

Reviewed-by: Christoph Hellwig <h...@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to