Commit 1c9de58a authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: comedi: cleanup comedi_recognize()

This function is more complicated than it needs to be because of the
consts.  It's not worth saving them when we drop the consts anyway
when we return (void *)name_ptr.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc:
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5254cbe7
......@@ -304,14 +304,13 @@ static int postconfig(struct comedi_device *dev)
* that register their supported board names */
static void *comedi_recognize(struct comedi_driver *driv, const char *name)
{
unsigned i;
const char *const *name_ptr = driv->board_name;
char **name_ptr = (char **)driv->board_name;
int i;
for (i = 0; i < driv->num_names; i++) {
if (strcmp(*name_ptr, name) == 0)
return (void *)name_ptr;
name_ptr =
(const char *const *)((const char *)name_ptr +
driv->offset);
return name_ptr;
name_ptr = (void *)name_ptr + driv->offset;
}
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment