fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ira.weiny@intel.com
To: fstests@vger.kernel.org
Cc: Ira Weiny <ira.weiny@intel.com>
Subject: [PATCH 3/3] src/locktest: Remove unused buf allocation
Date: Tue,  3 Sep 2019 14:08:15 -0700	[thread overview]
Message-ID: <20190903210815.29545-4-ira.weiny@intel.com> (raw)
In-Reply-To: <20190903210815.29545-1-ira.weiny@intel.com>

From: Ira Weiny <ira.weiny@intel.com>

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
 src/locktest.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/src/locktest.c b/src/locktest.c
index 6030c7a8a909..8e27e922668e 100644
--- a/src/locktest.c
+++ b/src/locktest.c
@@ -81,7 +81,6 @@ static char	*prog;
 static char	*filename = 0;
 static int	debug = 0;
 static int	server = 1;
-static int	maxio = 8192;
 static int	port = 0;
 static int 	testnumber = -1;
 static int	saved_errno = 0;
@@ -89,7 +88,6 @@ static int	saved_errno = 0;
 static SOCKET	s_fd = -1;              /* listen socket    */
 static SOCKET	c_fd = -1;	        /* IPC socket       */
 static HANDLE	f_fd = INVALID_HANDLE;	/* shared file      */
-static char	*buf;		        /* I/O buffer       */
 
 #define 	WRLOCK	0
 #define 	RDLOCK	1
@@ -806,16 +804,6 @@ main(int argc, char *argv[])
     if (do_open(O_RDWR) == FAIL)
 	exit(1);
 
-    /*
-     * +10 is slop for the iteration number if do_write() ... never
-     * needed unless maxio is very small
-     */
-    if ((buf = (char *)malloc(maxio + 10)) == NULL) {
-        perror("malloc buf");
-        exit(1);
-        /*NOTREACHED*/
-    }
-
     setbuf(stderr, NULL);
 
     if (server) {
@@ -1134,10 +1122,6 @@ main(int argc, char *argv[])
     if(server)
 	printf("%d tests run, %d failed\n", test_count, fail_count);
 }   
-    if (buf) {
-        free(buf);
-    }
-
     
     exit(fail_count);
     /*NOTREACHED*/
-- 
2.20.1

      parent reply	other threads:[~2019-09-03 21:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 21:08 [PATCH 0/3] src/locktest: 3 fixes for locktest ira.weiny
2019-09-03 21:08 ` [PATCH 1/3] src/locktest: Remove D_flag ira.weiny
2019-09-03 21:08 ` [PATCH 2/3] src/locktest: Update test header comment ira.weiny
2019-09-03 21:08 ` ira.weiny [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190903210815.29545-4-ira.weiny@intel.com \
    --to=ira.weiny@intel.com \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).