]> sourceware.org Git - systemtap.git/commitdiff
More gcc 4.5 'jump skips variable initialization' fixlets.
authorMark Wielaard <mjw@redhat.com>
Wed, 8 Jul 2009 07:38:33 +0000 (09:38 +0200)
committerMark Wielaard <mjw@redhat.com>
Wed, 8 Jul 2009 07:41:09 +0000 (09:41 +0200)
* tapset/ioblock.stp (__bio_start_sect): Declare, then initialize variables
  that could (through kread) take an early jump.
* tapset/nfs_proc.stp (get_prot_from_client): Likewise.
* tapset/scsi.stp (scsi_timer_pending): Likewise.
* tapset/task.stp (task_cpu): Likewise.
  (task_open_file_handles): Likewise.

tapset/ioblock.stp
tapset/nfs_proc.stp
tapset/scsi.stp
tapset/task.stp

index 4bf7ad92b803b39581559d93ad9f596d53bc0cbb..bc64c4258ba705adcee4568be3abebf379f0f101 100644 (file)
@@ -47,9 +47,12 @@ function bio_rw_str(rw)
 /* returns start sector */
 function __bio_start_sect:long(bio:long)
 %{ /* pure */
-    struct bio *bio = (struct bio *)(long)THIS->bio;
-    struct block_device *bi_bdev = bio? kread(&(bio->bi_bdev)) : NULL;
-    struct hd_struct *bd_part = bi_bdev? kread(&(bi_bdev->bd_part)) : NULL;
+    struct bio *bio;
+    struct block_device *bi_bdev;
+    struct hd_struct *bd_part;
+    bio = (struct bio *)(long)THIS->bio;
+    bi_bdev = bio? kread(&(bio->bi_bdev)) : NULL;
+    bd_part = bi_bdev? kread(&(bi_bdev->bd_part)) : NULL;
     if (bd_part == NULL)
         THIS->__retvalue = -1;
     else
index 11463e9ad54930f0ba8725b8d72fbac88240adab..e3d9a78fadc1cb934423d04a86494bd7fb40cf90 100644 (file)
@@ -84,12 +84,18 @@ function get_prot_from_client:long(clnt:long) %{ /* pure */
   1:get proto
 */
 function __i2n_ip_proto :long(dir:long,index:long) %{ /* pure */
-        int index = (int) (THIS->index);
-        struct inode * dir = (struct inode *)(uintptr_t)(THIS->dir);
-        struct rpc_clnt * clnt = NFS_CLIENT(dir); /* FIXME: deref hazard! */
-        struct rpc_xprt * cl_xprt = kread(&(clnt->cl_xprt));
+        int index;
+        struct inode * dir;
+        struct rpc_clnt * clnt;
+        struct rpc_xprt * cl_xprt;
+        struct sockaddr_in *addr;
+
+        index = (int) (THIS->index);
+        dir = (struct inode *)(uintptr_t)(THIS->dir);
+        clnt = NFS_CLIENT(dir); /* FIXME: deref hazard! */
+        cl_xprt = kread(&(clnt->cl_xprt));
        /* sockaddr_storage is used since 2.6.19. Need cast*/
-       struct sockaddr_in *addr = (struct sockaddr_in *)&(cl_xprt->addr);
+       addr = (struct sockaddr_in *)&(cl_xprt->addr);
 
         if(index == 0) {
                 if (kread(&(addr->sin_family)) == AF_INET) {
index e1457739dcdd3d8af27a1401beb5d7fb1b1249c0..5758f315114444be2d5318e12547b0d50b34b1a9 100644 (file)
@@ -130,8 +130,10 @@ function scsi_timer_pending:long(var:long)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
         THIS->__retvalue = timer_pending(&cmd->eh_timeout); /* FIXME: deref hazard! */
 #else 
-        struct request *req = (struct request *)kread(&cmd->request);
-        struct request_queue *rq = (struct request_queue *)kread(&req->q);
+        struct request *req;
+        struct request_queue *rq;
+        req = (struct request *)kread(&cmd->request);
+        rq = (struct request_queue *)kread(&req->q);
         THIS->__retvalue = timer_pending(&rq->timeout); /* FIXME: deref hazard! */
         CATCH_DEREF_FAULT();
 #endif
index f1a10b0a78bf09058b6a2328b6d38f5b8cd36f39..1f4e0e6f53f0e183984349849919c54771b40dc0 100644 (file)
@@ -189,10 +189,13 @@ function task_cpu:long (task:long)
 function task_open_file_handles:long (task:long)
 %( kernel_v >= "2.6.15" %?
 %{ /* pure */
-    struct task_struct *t = (struct task_struct *)(long)THIS->task;
-    struct files_struct *fs = kread(&(t->files));
-    struct fdtable *f = kread(&(fs->fdt));
     unsigned int count=0, fd, max;
+    struct task_struct *t;
+    struct files_struct *fs;
+    struct fdtable *f;
+    t = (struct task_struct *)(long)THIS->task;
+    fs = kread(&(t->files));
+    f = kread(&(fs->fdt));
     rcu_read_lock();
     max = kread(&(f->max_fds));
     for (fd = 0; fd < max; fd++) {
@@ -205,9 +208,11 @@ function task_open_file_handles:long (task:long)
 %}
 %:
 %{ /* pure */
-    struct task_struct *t = (struct task_struct *)(long)THIS->task;
-    struct files_struct *f = kread(&(t->files));
     unsigned int count=0, fd, max;
+    struct task_struct *t;
+    struct files_struct *f;
+    t = (struct task_struct *)(long)THIS->task;
+    f = kread(&(t->files));
     rcu_read_lock();
     max = kread(&(f->max_fds));
     for (fd = 0; fd < max; fd++) {
@@ -225,9 +230,12 @@ function task_open_file_handles:long (task:long)
 function task_max_file_handles:long (task:long)
 %( kernel_v >= "2.6.15" %?
 %{ /* pure */
-    struct task_struct *t = (struct task_struct *)(long)THIS->task;
-    struct files_struct *fs = kread (&(t->files));
-    struct fdtable *f = kread(&(fs->fdt));
+    struct task_struct *t;
+    struct files_struct *fs;
+    struct fdtable *f;
+    t = (struct task_struct *)(long)THIS->task;
+    fs = kread (&(t->files));
+    f = kread(&(fs->fdt));
     rcu_read_lock();
     THIS->__retvalue = kread(&(f->max_fds));
     rcu_read_unlock();
@@ -235,8 +243,10 @@ function task_max_file_handles:long (task:long)
 %}
 %:
 %{ /* pure */
-    struct task_struct *t = (struct task_struct *)(long)THIS->task;
-    struct files_struct *f = kread(&(t->files));
+    struct task_struct *t;
+    struct files_struct *f;
+    t = (struct task_struct *)(long)THIS->task;
+    f = kread(&(t->files));
     rcu_read_lock();
     THIS->__retvalue = kread(&(f->max_fds));
     rcu_read_unlock();
This page took 0.034443 seconds and 5 git commands to generate.