lkml.org 
[lkml]   [2018]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/18] staging: gasket: device registration error and unregister fixups
On Fri, Jul 13, 2018 at 10:58:02PM -0700, Todd Poynor wrote:
> @@ -376,7 +377,10 @@ int gasket_register_device(const struct gasket_driver_desc *driver_desc)
> fail1:
> class_destroy(internal->class);
>
> +fail0:

GW-BASIC sytle label names are an anti-pattern. It's better to name the
labels after what they do, just like function names describes what the
function does. Here it would be "goto clear_desc;" or something. It
doesn't have to be perfect but so long as you *try* to name it something
useful that's better than not trying.

> + mutex_lock(&g_mutex);
> g_descs[desc_idx].driver_desc = NULL;
> + mutex_unlock(&g_mutex);
> return ret;
> }

regards,
dan carpenter

\
 
 \ /
  Last update: 2018-07-16 15:55    [W:0.193 / U:9.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site