Skip to content

Commit

Permalink
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/…
Browse files Browse the repository at this point in the history
…mmarek/kbuild

Pull kbuild misc updates from Michal Marek:
 "This is the non-critical part of kbuild for v3.16-rc1:
   - make deb-pkg can do s390x and arm64
   - new patterns in scripts/tags.sh
   - scripts/tags.sh skips userspace tools' sources (which sometimes
     have copies of kernel structures) and symlinks
   - improvements to the objdiff tool
   - two new coccinelle patches
   - other minor fixes"

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  scripts: objdiff: support directories for the augument of record command
  scripts: objdiff: fix a comment
  scripts: objdiff: change the extension of disassembly from .o to .dis
  scripts: objdiff: improve path flexibility for record command
  scripts: objdiff: remove unnecessary code
  scripts: objdiff: direct error messages to stderr
  scripts: objdiff: get the path to .tmp_objdiff more simply
  deb-pkg: Add automatic support for s390x architecture
  coccicheck: Add unneeded return variable test
  kbuild: Fix a typo in documentation
  kbuild: trivial - use tabs for code indent where possible
  kbuild: trivial - remove trailing empty lines
  coccinelle: Check for missing NULL terminators in of_device_id tables
  scripts/tags.sh: ignore symlink'ed source files
  scripts/tags.sh: add regular expression replacement pattern for memcg
  builddeb: add arm64 in the supported architectures
  builddeb: use $OBJCOPY variable instead of objcopy
  scripts/tags.sh: ignore code of user space tools
  scripts/tags.sh: add pattern for DEFINE_HASHTABLE
  .gitignore: ignore Module.symvers in all directories
  • Loading branch information
torvalds committed Jun 13, 2014
2 parents 1700ff8 + 7fa0e6d commit c1fdb2d
Show file tree
Hide file tree
Showing 50 changed files with 293 additions and 162 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*.lst
*.symtypes
*.order
modules.builtin
*.elf
*.bin
*.gz
Expand All @@ -33,6 +32,8 @@ modules.builtin
*.lzo
*.patch
*.gcno
modules.builtin
Module.symvers

#
# Top-level generic files
Expand All @@ -44,7 +45,6 @@ modules.builtin
/vmlinuz
/System.map
/Module.markers
/Module.symvers

#
# Debian directory (make deb-pkg)
Expand Down
2 changes: 1 addition & 1 deletion Documentation/kbuild/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ build.

Sometimes, an external module uses exported symbols from
another external module. kbuild needs to have full knowledge of
all symbols to avoid spliitting out warnings about undefined
all symbols to avoid spitting out warnings about undefined
symbols. Three solutions exist for this situation.

NOTE: The method with a top-level kbuild file is recommended
Expand Down
1 change: 0 additions & 1 deletion scripts/Makefile.asm-generic
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ all: $(patsubst %, $(obj)/%, $(generic-y))

$(obj)/%.h:
$(call cmd,wrap)

1 change: 0 additions & 1 deletion scripts/Makefile.host
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,3 @@ $(host-cshlib): $(obj)/%: $(host-cshobjs) FORCE

targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\
$(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs)

8 changes: 4 additions & 4 deletions scripts/basic/fixdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,10 @@ static void print_deps(void)
exit(2);
}
if (fstat(fd, &st) < 0) {
fprintf(stderr, "fixdep: error fstat'ing depfile: ");
perror(depfile);
exit(2);
}
fprintf(stderr, "fixdep: error fstat'ing depfile: ");
perror(depfile);
exit(2);
}
if (st.st_size == 0) {
fprintf(stderr,"fixdep: %s is empty\n",depfile);
close(fd);
Expand Down
1 change: 0 additions & 1 deletion scripts/checkstack.pl
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,3 @@

# Sort output by size (last field)
print sort { ($b =~ /:\t*(\d+)$/)[0] <=> ($a =~ /:\t*(\d+)$/)[0] } @stack;

62 changes: 62 additions & 0 deletions scripts/coccinelle/misc/of_table.cocci
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/// Make sure of_device_id tables are NULL terminated
//
// Keywords: of_table
// Confidence: Medium
// Options: --include-headers

virtual patch
virtual context
virtual org
virtual report

@depends on context@
identifier var, arr;
expression E;
@@
struct of_device_id arr[] = {
...,
{
.var = E,
* }
};

@depends on patch@
identifier var, arr;
expression E;
@@
struct of_device_id arr[] = {
...,
{
.var = E,
- }
+ },
+ { }
};

@r depends on org || report@
position p1;
identifier var, arr;
expression E;
@@
struct of_device_id arr[] = {
...,
{
.var = E,
}
@p1
};

@script:python depends on org@
p1 << r.p1;
arr << r.arr;
@@
cocci.print_main(arr,p1)
@script:python depends on report@
p1 << r.p1;
arr << r.arr;
@@
msg = "%s is not NULL terminated at line %s" % (arr, p1[0].line)
coccilib.report.print_report(p1[0],msg)
66 changes: 66 additions & 0 deletions scripts/coccinelle/misc/returnvar.cocci
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
///
/// Removes unneeded variable used to store return value.
///
// Confidence: Moderate
// Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6. GPLv2.
// URL: http://coccinelle.lip6.fr/
// Comments: Comments on code can be deleted if near code that is removed.
// "when strict" can be removed to get more hits, but adds false
// positives
// Options: --no-includes --include-headers

virtual patch
virtual report
virtual context
virtual org

@depends on patch@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
when strict
return
- ret
+ C
;

@depends on context@
type T;
constant C;
identifier ret;
@@
* T ret = C;
... when != ret
when strict
* return ret;

@r1 depends on report || org@
type T;
constant C;
identifier ret;
position p1, p2;
@@
T ret@p1 = C;
... when != ret
when strict
return ret@p2;

@script:python depends on report@
p1 << r1.p1;
p2 << r1.p2;
C << r1.C;
ret << r1.ret;
@@
coccilib.report.print_report(p1[0], "Unneeded variable: \"" + ret + "\". Return \"" + C + "\" on line " + p2[0].line)
@script:python depends on org@
p1 << r1.p1;
p2 << r1.p2;
C << r1.C;
ret << r1.ret;
@@
cocci.print_main("unneeded \"" + ret + "\" variable", p1)
cocci.print_sec("return " + C + " here", p2)
1 change: 0 additions & 1 deletion scripts/config
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,3 @@ while [ "$1" != "" ] ; do
;;
esac
done

56 changes: 28 additions & 28 deletions scripts/docproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ int symfilecnt = 0;
static void add_new_symbol(struct symfile *sym, char * symname)
{
sym->symbollist =
realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *));
realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *));
sym->symbollist[sym->symbolcnt++].name = strdup(symname);
}

Expand Down Expand Up @@ -215,7 +215,7 @@ static void find_export_symbols(char * filename)
char *p;
char *e;
if (((p = strstr(line, "EXPORT_SYMBOL_GPL")) != NULL) ||
((p = strstr(line, "EXPORT_SYMBOL")) != NULL)) {
((p = strstr(line, "EXPORT_SYMBOL")) != NULL)) {
/* Skip EXPORT_SYMBOL{_GPL} */
while (isalnum(*p) || *p == '_')
p++;
Expand Down Expand Up @@ -291,28 +291,28 @@ static void extfunc(char * filename) { docfunctions(filename, FUNCTION); }
static void singfunc(char * filename, char * line)
{
char *vec[200]; /* Enough for specific functions */
int i, idx = 0;
int startofsym = 1;
int i, idx = 0;
int startofsym = 1;
vec[idx++] = KERNELDOC;
vec[idx++] = DOCBOOK;
vec[idx++] = SHOWNOTFOUND;

/* Split line up in individual parameters preceded by FUNCTION */
for (i=0; line[i]; i++) {
if (isspace(line[i])) {
line[i] = '\0';
startofsym = 1;
continue;
}
if (startofsym) {
startofsym = 0;
vec[idx++] = FUNCTION;
vec[idx++] = &line[i];
}
}
/* Split line up in individual parameters preceded by FUNCTION */
for (i=0; line[i]; i++) {
if (isspace(line[i])) {
line[i] = '\0';
startofsym = 1;
continue;
}
if (startofsym) {
startofsym = 0;
vec[idx++] = FUNCTION;
vec[idx++] = &line[i];
}
}
for (i = 0; i < idx; i++) {
if (strcmp(vec[i], FUNCTION))
continue;
if (strcmp(vec[i], FUNCTION))
continue;
consume_symbol(vec[i + 1]);
}
vec[idx++] = filename;
Expand Down Expand Up @@ -460,14 +460,14 @@ static void parse_file(FILE *infile)
break;
case 'D':
while (*s && !isspace(*s)) s++;
*s = '\0';
symbolsonly(line+2);
break;
*s = '\0';
symbolsonly(line+2);
break;
case 'F':
/* filename */
while (*s && !isspace(*s)) s++;
*s++ = '\0';
/* function names */
/* function names */
while (isspace(*s))
s++;
singlefunctions(line +2, s);
Expand Down Expand Up @@ -515,11 +515,11 @@ int main(int argc, char *argv[])
}
/* Open file, exit on error */
infile = fopen(argv[2], "r");
if (infile == NULL) {
fprintf(stderr, "docproc: ");
perror(argv[2]);
exit(2);
}
if (infile == NULL) {
fprintf(stderr, "docproc: ");
perror(argv[2]);
exit(2);
}

if (strcmp("doc", argv[1]) == 0) {
/* Need to do this in two passes.
Expand Down
1 change: 0 additions & 1 deletion scripts/dtc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ dtc
dtc-lexer.lex.c
dtc-parser.tab.c
dtc-parser.tab.h

1 change: 0 additions & 1 deletion scripts/dtc/fstree.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,3 @@ struct boot_info *dt_from_fs(const char *dirname)

return build_boot_info(NULL, tree, guess_boot_cpuid(tree));
}

1 change: 0 additions & 1 deletion scripts/dtc/libfdt/fdt_empty_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,3 @@ int fdt_create_empty_tree(void *buf, int bufsize)

return fdt_open_into(buf, buf, bufsize);
}

1 change: 0 additions & 1 deletion scripts/dtc/treesource.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,3 @@ void dt_to_source(FILE *f, struct boot_info *bi)

write_tree_source_node(f, bi->dt, 0);
}

2 changes: 0 additions & 2 deletions scripts/headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ for arch in ${archs}; do
;;
esac
done


2 changes: 1 addition & 1 deletion scripts/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static int read_symbol(FILE *in, struct sym_entry *s)
}
if (strlen(str) > KSYM_NAME_LEN) {
fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n"
"Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
"Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
str, strlen(str), KSYM_NAME_LEN);
return -1;
}
Expand Down
1 change: 0 additions & 1 deletion scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,3 @@ $(obj)/%.moc: $(src)/%.h $(obj)/.tmp_qtcheck
$(obj)/gconf.glade.h: $(obj)/gconf.glade
$(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
$(obj)/gconf.glade

1 change: 0 additions & 1 deletion scripts/kconfig/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ EOF
if [ ! "$?" -eq "0" ]; then
echo -DKBUILD_NO_NLS;
fi

2 changes: 1 addition & 1 deletion scripts/kconfig/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ int main(int ac, char **av)
} else if (input_mode == savedefconfig) {
if (conf_write_defconfig(defconfig_file)) {
fprintf(stderr, _("n*** Error while saving defconfig to: %s\n\n"),
defconfig_file);
defconfig_file);
return 1;
}
} else if (input_mode != listnewconfig) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/gconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ static void display_tree(struct menu *menu)
&& (tree == tree2))
continue;
/*
if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT))
if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT))
|| (view_mode == FULL_VIEW)
|| (view_mode == SPLIT_VIEW))*/

Expand Down
4 changes: 2 additions & 2 deletions scripts/kconfig/lxdialog/checklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ int dialog_checklist(const char *title, const char *prompt, int height,

/* create new window for the list */
list = subwin(dialog, list_height, list_width, y + box_y + 1,
x + box_x + 1);
x + box_x + 1);

keypad(list, TRUE);

/* draw a box around the list items */
draw_box(dialog, box_y, box_x, list_height + 2, list_width + 2,
dlg.menubox_border.atr, dlg.menubox.atr);
dlg.menubox_border.atr, dlg.menubox.atr);

/* Find length of longest item in order to center checklist */
check_x = 0;
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/lxdialog/inputbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
* Display a dialog box for inputing a string
*/
int dialog_inputbox(const char *title, const char *prompt, int height, int width,
const char *init)
const char *init)
{
int i, x, y, box_y, box_x, box_width;
int input_x = 0, key = 0, button = -1;
Expand Down
Loading

0 comments on commit c1fdb2d

Please sign in to comment.