From accfed28f5d0463a187e59d56bf025c466ce7582 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 14 Aug 2012 11:19:00 +0300 Subject: [PATCH] db: remove the return_info table This was used for storing user data and return values. The return values moved to a return_values tables and the user data moved to return_states. Generally return_states is the replacement for return_info. Signed-off-by: Dan Carpenter --- smatch_scripts/db/fill_db_return_info.pl | 81 -------------------------------- smatch_scripts/db/return_info.schema | 4 -- 2 files changed, 85 deletions(-) delete mode 100755 smatch_scripts/db/fill_db_return_info.pl delete mode 100644 smatch_scripts/db/return_info.schema diff --git a/smatch_scripts/db/fill_db_return_info.pl b/smatch_scripts/db/fill_db_return_info.pl deleted file mode 100755 index 84f5f949..00000000 --- a/smatch_scripts/db/fill_db_return_info.pl +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use DBI; - -my $warns = shift; - -if (!defined($warns)) { - print "usage: $0 \n"; - exit(1); -} - -my $db = DBI->connect("dbi:SQLite:smatch_db.sqlite", "", "", {RaiseError => 1, AutoCommit => 0}); -$db->do("PRAGMA synchronous = OFF"); -$db->do("PRAGMA cache_size = 800000"); -$db->do("PRAGMA journal_mode = OFF"); - -$db->do("delete from return_info"); - -my $type = 5; # RETURN_VALUE -open(WARNS, "<$warns"); -while () { - if (!($_ =~ /info: return_value /)) { - next; - } - - s/\n//; - - my ($file_and_line, $file, $func, $dummy, $value, $gs); - - # sound/pci/hda/patch_sigmatel.c:3125 create_controls_idx() info: return_value min-(-1) global - - ($file_and_line, $func, $dummy, $dummy, $value, $gs) = split(/ /, $_); - ($file, $dummy) = split(/:/, $file_and_line); - $func =~ s/\(\)//; - $value =~ s/unknown/min-max/; - - if (!defined($gs)) { - next; - } - my $static = 0; - if ($gs =~ /static/) { - $static = 1; - } - - $value =~ s/'//g; - - $db->do("insert into return_info values ('$file', '$func', $static, $type, '$value')"); -} -close(WARNS); - -$type = 3; # USER_DATA -open(WARNS, "<$warns"); -while () { - if (!($_ =~ /info: returns_user_data/)) { - next; - } - - s/\n//; - - my ($file_and_line, $file, $func, $dummy, $gs); - - #include/linux/netfilter/ipset/ip_set.h:402 ip_set_get_h32() info: returns_user_data static - - ($file_and_line, $func, $dummy, $gs) = split(/ /, $_); - ($file, $dummy) = split(/:/, $file_and_line); - $func =~ s/\(\)//; - - my $static = 0; - if ($gs =~ /static/) { - $static = 1; - } - - $db->do("insert into return_info values ('$file', '$func', $static, $type, '1')"); -} -close(WARNS); - -$db->do("delete from return_info where function='strnlen';"); - -$db->commit(); -$db->disconnect(); diff --git a/smatch_scripts/db/return_info.schema b/smatch_scripts/db/return_info.schema deleted file mode 100644 index c913bfb3..00000000 --- a/smatch_scripts/db/return_info.schema +++ /dev/null @@ -1,4 +0,0 @@ -CREATE TABLE return_info (file varchar(256), function varchar(256), static integer, type integer, value varchar(256)); - -CREATE INDEX return_info_fn_idx on return_info (function); -CREATE INDEX return_info_ff_idx on return_info (file, function); -- 2.11.4.GIT