]> Pileus Git - ~andy/linux/blobdiff - drivers/gpu/drm/radeon/mkregtable.c
radeon: remove redundant __list_for_each definition from mkregtable.c
[~andy/linux] / drivers / gpu / drm / radeon / mkregtable.c
index 607241c6a8a9a80d2f477c4dbc5da69eb7cd5952..af85299f212673afd9ce61997aa98b2f286fd2a7 100644 (file)
@@ -372,19 +372,6 @@ static inline void list_splice_tail_init(struct list_head *list,
        for (pos = (head)->next; prefetch(pos->next), pos != (head); \
                pos = pos->next)
 
-/**
- * __list_for_each     -       iterate over a list
- * @pos:       the &struct list_head to use as a loop cursor.
- * @head:      the head for your list.
- *
- * This variant differs from list_for_each() in that it's the
- * simplest possible list iteration code, no prefetching is done.
- * Use this for code that knows the list to be very short (empty
- * or 1 entry) most of the time.
- */
-#define __list_for_each(pos, head) \
-       for (pos = (head)->next; pos != (head); pos = pos->next)
-
 /**
  * list_for_each_prev  -       iterate over a list backwards
  * @pos:       the &struct list_head to use as a loop cursor.
@@ -673,8 +660,10 @@ static int parser_auth(struct table *t, const char *filename)
        last_reg = strtol(last_reg_s, NULL, 16);
 
        do {
-               if (fgets(buf, 1024, file) == NULL)
+               if (fgets(buf, 1024, file) == NULL) {
+                       fclose(file);
                        return -1;
+               }
                len = strlen(buf);
                if (ftell(file) == end)
                        done = 1;
@@ -685,6 +674,7 @@ static int parser_auth(struct table *t, const char *filename)
                                fprintf(stderr,
                                        "Error matching regular expression %d in %s\n",
                                        r, filename);
+                               fclose(file);
                                return -1;
                        } else {
                                buf[match[0].rm_eo] = 0;