lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a6eab3c7-f1dd-82db-1cc0-35997c04bd7d@suse.de>
Date:   Fri, 23 Oct 2020 09:13:30 +0200
From:   Thomas Zimmermann <tzimmermann@...e.de>
To:     Bernard Zhao <bernard@...o.com>, Dave Airlie <airlied@...hat.com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Cc:     opensource.kernel@...o.com
Subject: Re: [PATCH] gpu/drm/mgag200:remove break after return

Hi

On 23.10.20 09:00, Bernard Zhao wrote:
> In function mgag200_set_pci_regs, there are some switch cases
> returned, then break. These break will never run.
> This patch is to make the code a bit readable.
> 
> Signed-off-by: Bernard Zhao <bernard@...o.com>
> ---
>  drivers/gpu/drm/mgag200/mgag200_mode.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
> index 38672f9e5c4f..de873a5d276e 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_mode.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
> @@ -794,20 +794,17 @@ static int mgag200_crtc_set_plls(struct mga_device *mdev, long clock)
>  	case G200_SE_A:
>  	case G200_SE_B:
>  		return mga_g200se_set_plls(mdev, clock);
> -		break;
>  	case G200_WB:
>  	case G200_EW3:
>  		return mga_g200wb_set_plls(mdev, clock);
> -		break;
>  	case G200_EV:
>  		return mga_g200ev_set_plls(mdev, clock);
> -		break;
>  	case G200_EH:
>  	case G200_EH3:
>  		return mga_g200eh_set_plls(mdev, clock);
> -		break;
>  	case G200_ER:
>  		return mga_g200er_set_plls(mdev, clock);
> +	default:

No default case here. If one of the enum values is not handled by the
switch, the compiler should warn about it.

Best regards
Thomas

>  		break;
>  	}
>  
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ