staging: Make some structures static
authorJulia Lawall <julia@diku.dk>
Fri, 14 Aug 2009 20:10:00 +0000 (22:10 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Sep 2009 19:02:24 +0000 (12:02 -0700)
This was done using a semantic patch (http://coccinelle.lip6.fr/) that
checks that the declaration is not inside a function definition, that the
defined variable is not exported using EXPORTED_SYMBOL, etc, and that the
defined variable does not occur in any other file.  If these conditions
hold, static is added before the declaration.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/android/binder.c
drivers/staging/dream/qdsp5/audio_aac.c
drivers/staging/dream/qdsp5/audio_in.c
drivers/staging/dream/qdsp5/audio_mp3.c
drivers/staging/dream/qdsp5/audio_out.c
drivers/staging/dream/smd/smd_rpcrouter.c
drivers/staging/otus/80211core/performance.c
drivers/staging/otus/hal/hpmain.c

index c6dc58eee400b9b249b4b6a7ae19294ec377b36f..99010d4b3044b2c33c9d709e334b5be7871b9599 100644 (file)
@@ -164,8 +164,8 @@ struct binder_transaction_log {
        int full;
        struct binder_transaction_log_entry entry[32];
 };
-struct binder_transaction_log binder_transaction_log;
-struct binder_transaction_log binder_transaction_log_failed;
+static struct binder_transaction_log binder_transaction_log;
+static struct binder_transaction_log binder_transaction_log_failed;
 
 static struct binder_transaction_log_entry *binder_transaction_log_add(
        struct binder_transaction_log *log)
index 1c20f28e7bf04293ca68f1d4d4623a3f81cfad34..ad2390f32a4f59bf903abac35d385886e3313844 100644 (file)
@@ -950,7 +950,7 @@ static int audio_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-struct audio the_aac_audio;
+static struct audio the_aac_audio;
 
 static int audio_open(struct inode *inode, struct file *file)
 {
index 6df70d812f04bd2927309bfbb1427d9dbe1287b9..3d950a245895f92a24964db9ae8aa6b2211e29d9 100644 (file)
@@ -785,7 +785,7 @@ static int audio_in_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-struct audio_in the_audio_in;
+static struct audio_in the_audio_in;
 
 static int audio_in_open(struct inode *inode, struct file *file)
 {
index 72b8d70d716e56ce86e579ac894bf41eacc63e32..b95574f699ff9ec84c8b1dac75567528687550ac 100644 (file)
@@ -864,7 +864,7 @@ static int audio_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-struct audio the_mp3_audio;
+static struct audio the_mp3_audio;
 
 static int audio_open(struct inode *inode, struct file *file)
 {
index 5a76ecca2fad2149e36e8097a349a9ee7e0b8cd4..d1adcf65f2bd243dfc8cd6a71b623089b70f61a4 100644 (file)
@@ -699,7 +699,7 @@ static int audio_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-struct audio the_audio;
+static struct audio the_audio;
 
 static int audio_open(struct inode *inode, struct file *file)
 {
index 56557b894db2c7730bcc36c46c2b9703d4dea4b4..d4a4a887e428554bab3cfaf30f3aae2b3db62e5e 100644 (file)
@@ -122,7 +122,7 @@ struct rr_context {
        uint32_t count; /* bytes needed in this state */
 };
 
-struct rr_context the_rr_context;
+static struct rr_context the_rr_context;
 
 static struct platform_device rpcrouter_pdev = {
        .name           = "oncrpc_router",
index 51b42d54f653c301c2d3f3aa857988a286530d4b..4c10e1d7afd641d1be38731c685f341452f1dd1d 100644 (file)
@@ -27,9 +27,9 @@
 #ifdef ZM_ENABLE_PERFORMANCE_EVALUATION
 
 #define ZM_TP_SIZE 50
-struct zsSummary zm_summary;
-struct zsVariation zm_var;
-struct zsThroughput zm_tp;
+static struct zsSummary zm_summary;
+static struct zsVariation zm_var;
+static struct zsThroughput zm_tp;
 
 void zfiPerformanceInit(zdev_t* dev)
 {
index 322585be2c88099f54bff1b6ef211a60365026e1..94f9cbbbdefce6cb1fd0a2e66377762f71f272fe 100644 (file)
@@ -76,7 +76,7 @@ u32_t zfHpEchoCommand(zdev_t* dev, u32_t value);
 
 
 #define zm_hp_priv(x) (((struct zsHpPriv*)wd->hpPrivate)->x)
-struct zsHpPriv zgHpPriv;
+static struct zsHpPriv zgHpPriv;
 
 #define ZM_FIRMWARE_WLAN_ADDR           0x200000
 #define ZM_FIRMWARE_SPI_ADDR      0x114000