Re: [PATCH 6/6] GPU-DRM-GMA500: Rename a jump label in mid_get_vbt_data()

2016-09-20 Thread Dan Carpenter
On Tue, Sep 20, 2016 at 01:08:12PM +0300, Jani Nikula wrote:
> On Tue, 20 Sep 2016, SF Markus Elfring  wrote:
> > From: Markus Elfring 
> > Date: Tue, 20 Sep 2016 10:40:22 +0200
> >
> > * Adjust a jump target.
> 
> Please don't.
> 

Also there is nothing in CodingStyle that prohibits out: labels.  I
wrote that section and I wrote it in a deliberately way because no one
wants to see a bunch of "cleanup" patches that change the label names
for no reason.

People have been complaining about this in the kernel-summit mailing
list as if CodingStyle bans out labels and that it's my fault.  Neither
of these complaints are accurate.

regards,
dan carpenter


Re: [PATCH 6/6] GPU-DRM-GMA500: Rename a jump label in mid_get_vbt_data()

2016-09-20 Thread Dan Carpenter
On Tue, Sep 20, 2016 at 01:08:12PM +0300, Jani Nikula wrote:
> On Tue, 20 Sep 2016, SF Markus Elfring  wrote:
> > From: Markus Elfring 
> > Date: Tue, 20 Sep 2016 10:40:22 +0200
> >
> > * Adjust a jump target.
> 
> Please don't.
> 

Also there is nothing in CodingStyle that prohibits out: labels.  I
wrote that section and I wrote it in a deliberately way because no one
wants to see a bunch of "cleanup" patches that change the label names
for no reason.

People have been complaining about this in the kernel-summit mailing
list as if CodingStyle bans out labels and that it's my fault.  Neither
of these complaints are accurate.

regards,
dan carpenter


Re: [PATCH 6/6] GPU-DRM-GMA500: Rename a jump label in mid_get_vbt_data()

2016-09-20 Thread Jani Nikula
On Tue, 20 Sep 2016, SF Markus Elfring  wrote:
> From: Markus Elfring 
> Date: Tue, 20 Sep 2016 10:40:22 +0200
>
> * Adjust a jump target.

Please don't.

BR,
Jani.

>
> * Delete the explicit initialisation for the local variable "ret"
>   which became unnecessary with this refactoring.
>
> Signed-off-by: Markus Elfring 
> ---
>  drivers/gpu/drm/gma500/mid_bios.c | 11 +--
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/mid_bios.c 
> b/drivers/gpu/drm/gma500/mid_bios.c
> index e5cece0..602d16f 100644
> --- a/drivers/gpu/drm/gma500/mid_bios.c
> +++ b/drivers/gpu/drm/gma500/mid_bios.c
> @@ -284,7 +284,7 @@ static void mid_get_vbt_data(struct drm_psb_private 
> *dev_priv)
>   u8 __iomem *vbt_virtual;
>   struct mid_vbt_header vbt_header;
>   struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
> - int ret = -1;
> + int ret;
>  
>   /* Get the address of the platform config vbt */
>   pci_read_config_dword(pci_gfx_root, 0xFC, );
> @@ -293,18 +293,18 @@ static void mid_get_vbt_data(struct drm_psb_private 
> *dev_priv)
>   dev_dbg(dev->dev, "drm platform config address is %x\n", addr);
>  
>   if (!addr)
> - goto out;
> + goto report_failure;
>  
>   /* get the virtual address of the vbt */
>   vbt_virtual = ioremap(addr, sizeof(vbt_header));
>   if (!vbt_virtual)
> - goto out;
> + goto report_failure;
>  
>   memcpy_fromio(_header, vbt_virtual, sizeof(vbt_header));
>   iounmap(vbt_virtual);
>  
>   if (memcmp(_header.signature, "$GCT", 4))
> - goto out;
> + goto report_failure;
>  
>   dev_dbg(dev->dev, "GCT revision is %02x\n", vbt_header.revision);
>  
> @@ -322,9 +322,8 @@ static void mid_get_vbt_data(struct drm_psb_private 
> *dev_priv)
>   dev_err(dev->dev, "Unknown revision of GCT!\n");
>   return;
>   }
> -
> -out:
>   if (ret)
> + report_failure:
>   dev_err(dev->dev, "Unable to read GCT!");
>   else
>   dev_priv->has_gct = true;

-- 
Jani Nikula, Intel Open Source Technology Center


Re: [PATCH 6/6] GPU-DRM-GMA500: Rename a jump label in mid_get_vbt_data()

2016-09-20 Thread Jani Nikula
On Tue, 20 Sep 2016, SF Markus Elfring  wrote:
> From: Markus Elfring 
> Date: Tue, 20 Sep 2016 10:40:22 +0200
>
> * Adjust a jump target.

Please don't.

BR,
Jani.

>
> * Delete the explicit initialisation for the local variable "ret"
>   which became unnecessary with this refactoring.
>
> Signed-off-by: Markus Elfring 
> ---
>  drivers/gpu/drm/gma500/mid_bios.c | 11 +--
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/mid_bios.c 
> b/drivers/gpu/drm/gma500/mid_bios.c
> index e5cece0..602d16f 100644
> --- a/drivers/gpu/drm/gma500/mid_bios.c
> +++ b/drivers/gpu/drm/gma500/mid_bios.c
> @@ -284,7 +284,7 @@ static void mid_get_vbt_data(struct drm_psb_private 
> *dev_priv)
>   u8 __iomem *vbt_virtual;
>   struct mid_vbt_header vbt_header;
>   struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
> - int ret = -1;
> + int ret;
>  
>   /* Get the address of the platform config vbt */
>   pci_read_config_dword(pci_gfx_root, 0xFC, );
> @@ -293,18 +293,18 @@ static void mid_get_vbt_data(struct drm_psb_private 
> *dev_priv)
>   dev_dbg(dev->dev, "drm platform config address is %x\n", addr);
>  
>   if (!addr)
> - goto out;
> + goto report_failure;
>  
>   /* get the virtual address of the vbt */
>   vbt_virtual = ioremap(addr, sizeof(vbt_header));
>   if (!vbt_virtual)
> - goto out;
> + goto report_failure;
>  
>   memcpy_fromio(_header, vbt_virtual, sizeof(vbt_header));
>   iounmap(vbt_virtual);
>  
>   if (memcmp(_header.signature, "$GCT", 4))
> - goto out;
> + goto report_failure;
>  
>   dev_dbg(dev->dev, "GCT revision is %02x\n", vbt_header.revision);
>  
> @@ -322,9 +322,8 @@ static void mid_get_vbt_data(struct drm_psb_private 
> *dev_priv)
>   dev_err(dev->dev, "Unknown revision of GCT!\n");
>   return;
>   }
> -
> -out:
>   if (ret)
> + report_failure:
>   dev_err(dev->dev, "Unable to read GCT!");
>   else
>   dev_priv->has_gct = true;

-- 
Jani Nikula, Intel Open Source Technology Center