public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Denys Vlasenko <vda.linux@googlemail.com>
To: David Chinner <dgc@sgi.com>
Cc: Eric Sandeen <sandeen@sandeen.net>, Adrian Bunk <bunk@kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Shawn Bohrer <shawn.bohrer@gmail.com>,
	Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Arjan van de Ven <arjan@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH] xfs: remove unused params from functions in xfs_dir2_leaf.h
Date: Tue, 22 Apr 2008 15:32:22 +0200	[thread overview]
Message-ID: <200804221532.22701.vda.linux@googlemail.com> (raw)
In-Reply-To: <200804221351.03885.vda.linux@googlemail.com>

[-- Attachment #1: Type: text/plain, Size: 507 bytes --]

Hi David,

Inline functions xfs_dir2_dataptr_to_byte and xfs_dir2_byte_to_dataptr
are not using their 1st argument. gcc is able to optimize that out.

I still want to delete these parameters, as they serve no useful purpose
and by removing them I can make gcc to notice some additional
unused variables in the callers of these inlines, and warn me
about that.

There is no object code size difference from this change.

Compile tested only.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
--
vda 

[-- Attachment #2: xfs7-xfs_dir2_leaf.h-remove_unused_params.patch --]
[-- Type: text/x-diff, Size: 4887 bytes --]

diff -urpN linux-2.6-xfs5/fs/xfs/xfs_dir2_block.c linux-2.6-xfs6/fs/xfs/xfs_dir2_block.c
--- linux-2.6-xfs5/fs/xfs/xfs_dir2_block.c	2008-04-22 04:19:32.000000000 +0200
+++ linux-2.6-xfs6/fs/xfs/xfs_dir2_block.c	2008-04-22 12:19:44.000000000 +0200
@@ -397,7 +397,7 @@ xfs_dir2_block_addname(
 	 * Fill in the leaf entry.
 	 */
 	blp[mid].hashval = cpu_to_be32(args->hashval);
-	blp[mid].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(mp,
+	blp[mid].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(
 				(char *)dep - (char *)block));
 	xfs_dir2_block_log_leaf(tp, bp, lfloglow, lfloghigh);
 	/*
@@ -1124,7 +1124,7 @@ xfs_dir2_sf_to_block(
 	*tagp = cpu_to_be16((char *)dep - (char *)block);
 	xfs_dir2_data_log_entry(tp, bp, dep);
 	blp[0].hashval = cpu_to_be32(xfs_dir_hash_dot);
-	blp[0].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(mp,
+	blp[0].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(
 				(char *)dep - (char *)block));
 	/*
 	 * Create entry for ..
@@ -1138,7 +1138,7 @@ xfs_dir2_sf_to_block(
 	*tagp = cpu_to_be16((char *)dep - (char *)block);
 	xfs_dir2_data_log_entry(tp, bp, dep);
 	blp[1].hashval = cpu_to_be32(xfs_dir_hash_dotdot);
-	blp[1].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(mp,
+	blp[1].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(
 				(char *)dep - (char *)block));
 	offset = XFS_DIR2_DATA_FIRST_OFFSET;
 	/*
@@ -1189,7 +1189,7 @@ xfs_dir2_sf_to_block(
 		xfs_dir2_data_log_entry(tp, bp, dep);
 		blp[2 + i].hashval = cpu_to_be32(xfs_da_hashname(
 					(char *)sfep->name, sfep->namelen));
-		blp[2 + i].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(mp,
+		blp[2 + i].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(
 						 (char *)dep - (char *)block));
 		offset = (int)((char *)(tagp + 1) - (char *)block);
 		if (++i == sfp->hdr.count)
diff -urpN linux-2.6-xfs5/fs/xfs/xfs_dir2_leaf.c linux-2.6-xfs6/fs/xfs/xfs_dir2_leaf.c
--- linux-2.6-xfs5/fs/xfs/xfs_dir2_leaf.c	2008-04-22 04:18:27.000000000 +0200
+++ linux-2.6-xfs6/fs/xfs/xfs_dir2_leaf.c	2008-04-22 12:19:21.000000000 +0200
@@ -804,7 +804,7 @@ xfs_dir2_leaf_getdents(
 	 * Inside the loop we keep the main offset value as a byte offset
 	 * in the directory file.
 	 */
-	curoff = xfs_dir2_dataptr_to_byte(mp, *offset);
+	curoff = xfs_dir2_dataptr_to_byte(*offset);
 
 	/*
 	 * Force this conversion through db so we truncate the offset
@@ -1091,7 +1091,7 @@ xfs_dir2_leaf_getdents(
 		 * Won't fit.  Return to caller.
 		 */
 		if (filldir(dirent, dep->name, dep->namelen,
-			    xfs_dir2_byte_to_dataptr(mp, curoff),
+			    xfs_dir2_byte_to_dataptr(curoff),
 			    ino, DT_UNKNOWN))
 			break;
 
@@ -1106,10 +1106,10 @@ xfs_dir2_leaf_getdents(
 	/*
 	 * All done.  Set output offset value to current offset.
 	 */
-	if (curoff > xfs_dir2_dataptr_to_byte(mp, XFS_DIR2_MAX_DATAPTR))
+	if (curoff > xfs_dir2_dataptr_to_byte(XFS_DIR2_MAX_DATAPTR))
 		*offset = XFS_DIR2_MAX_DATAPTR;
 	else
-		*offset = xfs_dir2_byte_to_dataptr(mp, curoff);
+		*offset = xfs_dir2_byte_to_dataptr(curoff);
 	kmem_free(map);
 	if (bp)
 		xfs_da_brelse(NULL, bp);
diff -urpN linux-2.6-xfs5/fs/xfs/xfs_dir2_leaf.h linux-2.6-xfs6/fs/xfs/xfs_dir2_leaf.h
--- linux-2.6-xfs5/fs/xfs/xfs_dir2_leaf.h	2008-04-22 04:06:43.000000000 +0200
+++ linux-2.6-xfs6/fs/xfs/xfs_dir2_leaf.h	2008-04-22 12:19:29.000000000 +0200
@@ -112,7 +112,7 @@ xfs_dir2_leaf_bests_p(xfs_dir2_leaf_tail
  * Convert dataptr to byte in file space
  */
 static inline xfs_dir2_off_t
-xfs_dir2_dataptr_to_byte(struct xfs_mount *mp, xfs_dir2_dataptr_t dp)
+xfs_dir2_dataptr_to_byte(xfs_dir2_dataptr_t dp)
 {
 	return (xfs_dir2_off_t)(dp) << XFS_DIR2_DATA_ALIGN_LOG;
 }
@@ -121,7 +121,7 @@ xfs_dir2_dataptr_to_byte(struct xfs_moun
  * Convert byte in file space to dataptr.  It had better be aligned.
  */
 static inline xfs_dir2_dataptr_t
-xfs_dir2_byte_to_dataptr(struct xfs_mount *mp, xfs_dir2_off_t by)
+xfs_dir2_byte_to_dataptr(xfs_dir2_off_t by)
 {
 	return (xfs_dir2_dataptr_t)((by) >> XFS_DIR2_DATA_ALIGN_LOG);
 }
@@ -142,7 +142,7 @@ xfs_dir2_byte_to_db(struct xfs_mount *mp
 static inline xfs_dir2_db_t
 xfs_dir2_dataptr_to_db(struct xfs_mount *mp, xfs_dir2_dataptr_t dp)
 {
-	return xfs_dir2_byte_to_db(mp, xfs_dir2_dataptr_to_byte(mp, dp));
+	return xfs_dir2_byte_to_db(mp, xfs_dir2_dataptr_to_byte(dp));
 }
 
 /*
@@ -161,7 +161,7 @@ xfs_dir2_byte_to_off(struct xfs_mount *m
 static inline xfs_dir2_data_aoff_t
 xfs_dir2_dataptr_to_off(struct xfs_mount *mp, xfs_dir2_dataptr_t dp)
 {
-	return xfs_dir2_byte_to_off(mp, xfs_dir2_dataptr_to_byte(mp, dp));
+	return xfs_dir2_byte_to_off(mp, xfs_dir2_dataptr_to_byte(dp));
 }
 
 /*
@@ -200,7 +200,7 @@ static inline xfs_dir2_dataptr_t
 xfs_dir2_db_off_to_dataptr(struct xfs_mount *mp, xfs_dir2_db_t db,
 			   xfs_dir2_data_aoff_t o)
 {
-	return xfs_dir2_byte_to_dataptr(mp, xfs_dir2_db_off_to_byte(mp, db, o));
+	return xfs_dir2_byte_to_dataptr(xfs_dir2_db_off_to_byte(mp, db, o));
 }
 
 /*

  reply	other threads:[~2008-04-22 13:33 UTC|newest]

Thread overview: 157+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200804181737.m3IHbabI010051@hera.kernel.org>
2008-04-18 21:29 ` x86: 4kstacks default Andrew Morton
2008-04-19 14:23   ` Ingo Molnar
2008-04-19 14:35     ` Oliver Pinter
2008-04-19 15:19       ` Adrian Bunk
2008-04-19 15:42         ` Oliver Pinter
2008-04-20  1:56         ` Eric Sandeen
2008-04-20  7:42           ` Adrian Bunk
2008-04-20 16:59             ` Chris Wedgwood
     [not found]         ` <480AA2B9.10305__23983.3358479247$1208657639$gmane$org@sandeen.net>
2008-04-20 11:48           ` Andi Kleen
2008-04-19 14:59     ` Shawn Bohrer
2008-04-19 18:00       ` Arjan van de Ven
2008-04-19 18:33         ` Ingo Molnar
2008-04-19 19:10           ` Stefan Richter
2008-04-20  2:36         ` Eric Sandeen
2008-04-20  6:11           ` Arjan van de Ven
2008-04-20 22:53           ` David Chinner
2008-04-20  8:09       ` Adrian Bunk
2008-04-20  8:06         ` Alan Cox
2008-04-20  8:51           ` Adrian Bunk
2008-04-20  9:36             ` Alan Cox
2008-04-20 10:44               ` Adrian Bunk
2008-04-20 11:02                 ` Alan Cox
2008-04-20 11:54                   ` Adrian Bunk
2008-04-20 11:37                     ` Alan Cox
2008-04-20 12:18                       ` Adrian Bunk
2008-04-20 14:05                         ` Eric Sandeen
2008-04-20 14:21                           ` Adrian Bunk
2008-04-20 14:56                             ` Eric Sandeen
2008-04-20 15:41                           ` Arjan van de Ven
2008-04-20 16:03                             ` Adrian Bunk
2008-04-21  3:30                               ` Alexander E. Patrakov
2008-04-23  8:57                                 ` Helge Hafting
2008-04-21  7:45                           ` Denys Vlasenko
2008-04-21  9:55                             ` Andi Kleen
2008-04-21 13:29                             ` Eric Sandeen
2008-04-21 19:51                               ` Denys Vlasenko
2008-04-21 20:28                                 ` Denys Vlasenko
2008-04-22  1:28                                 ` David Chinner
2008-04-22  2:33                                   ` [PATCH] xfs: do not pass size into kmem_free, it's unused Denys Vlasenko
2008-04-22  3:03                                     ` [PATCH] xfs: do not pass unused params to xfs_flush_pages Denys Vlasenko
2008-04-22  3:14                                       ` [PATCH] xfs: use smaller int param in call " Denys Vlasenko
2008-04-22  3:18                                         ` Eric Sandeen
2008-04-22  4:10                                           ` David Chinner
2008-04-22  9:42                                         ` [PATCH] xfs: remove unused parameter of xfs_qm_dqpurge Denys Vlasenko
2008-04-22 10:16                                           ` [PATCH] xfs: remove unused parameter of xfs_iomap_write_allocate Denys Vlasenko
2008-04-22 11:20                                             ` [PATCH] xfs: #define out unused parameters of xfs_bmap_add_free and xfs_btree_read_bufl Denys Vlasenko
2008-04-22 11:48                                               ` [PATCH] xfs: #define out unused parameters for seven functions in xfs_trans.h Denys Vlasenko
2008-04-22 11:51                                               ` Denys Vlasenko
2008-04-22 13:32                                                 ` Denys Vlasenko [this message]
2008-04-22 13:40                                                   ` [PATCH] xfs: remove unused params from functions in xfs/quota/* Denys Vlasenko
2008-04-22 13:46                                                     ` [PATCH] xfs: expose no-op xfs_put_perag() Denys Vlasenko
2008-04-22 14:08                                                       ` Eric Sandeen
2008-04-22 23:16                                                       ` David Chinner
2008-04-22 23:08                                                     ` [PATCH] xfs: remove unused params from functions in xfs/quota/* David Chinner
2008-04-22 22:47                                                 ` [PATCH] xfs: #define out unused parameters for seven functions in xfs_trans.h David Chinner
2008-04-22 14:28                                               ` [PATCH] xfs: #define out unused parameters of xfs_bmap_add_free and xfs_btree_read_bufl Adrian Bunk
2008-04-22 16:17                                                 ` Denys Vlasenko
2008-04-22 17:21                                                   ` Adrian Bunk
2008-04-22 17:26                                                     ` Eric Sandeen
2008-04-22 17:50                                                       ` Denys Vlasenko
2008-04-22 18:28                                                         ` [PATCH] xfs: #define out unused parameters of?xfs_bmap_add_free " Adrian Bunk
2008-04-22 19:32                                                           ` Denys Vlasenko
2008-04-22 23:53                                                             ` Adrian Bunk
2008-04-22 20:46                                                       ` [PATCH] xfs: #define out unused parameters of xfs_bmap_add_free " Denys Vlasenko
2008-04-22 22:43                                               ` David Chinner
2008-04-22 22:33                                             ` [PATCH] xfs: remove unused parameter of xfs_iomap_write_allocate David Chinner
2008-04-22 22:11                                           ` [PATCH] xfs: remove unused parameter of xfs_qm_dqpurge David Chinner
2008-04-23  8:18                                           ` Christoph Hellwig
2008-04-22 22:08                                         ` [PATCH] xfs: use smaller int param in call to xfs_flush_pages David Chinner
2008-04-22  3:15                                       ` [PATCH] xfs: do not pass unused params " Eric Sandeen
2008-04-22  8:57                                         ` Denys Vlasenko
2008-04-22  9:56                                           ` Jakub Jelinek
2008-04-22 10:33                                             ` Denys Vlasenko
2008-04-22 12:51                                           ` Eric Sandeen
2008-04-22 22:07                                       ` David Chinner
2008-04-22  3:09                                     ` [PATCH] xfs: do not pass size into kmem_free, it's unused Eric Sandeen
2008-04-22  3:35                                       ` Eric Sandeen
2008-04-22 22:02                                     ` David Chinner
2008-04-22 12:48                                   ` x86: 4kstacks default Denys Vlasenko
2008-04-22 13:01                                     ` Adrian Bunk
2008-04-22 13:51                                       ` Denys Vlasenko
2008-04-27 19:27                                   ` Jörn Engel
2008-04-27 23:02                                     ` Denys Vlasenko
2008-04-27 23:08                                       ` Eric Sandeen
2008-04-28  0:00                                         ` Denys Vlasenko
2008-04-20 12:37                     ` Andi Kleen
2008-04-20 12:27                 ` Andi Kleen
2008-04-20 12:32                   ` Adrian Bunk
2008-04-20 12:47                   ` Willy Tarreau
2008-04-20 13:06                     ` Andi Kleen
2008-04-20 13:30                       ` Adrian Bunk
2008-04-20 13:34                         ` Willy Tarreau
2008-04-20 14:04                           ` Adrian Bunk
2008-04-28 17:56                         ` Bill Davidsen
2008-04-20 13:21                     ` Adrian Bunk
2008-04-23  9:13                       ` Helge Hafting
2008-04-23 23:29                         ` David Chinner
2008-04-24 15:46                         ` Eric Sandeen
2008-04-28 18:38                       ` Bill Davidsen
2008-04-20 13:27                     ` Mark Lord
2008-04-20 13:38                       ` Willy Tarreau
2008-04-20 14:19                         ` Andi Kleen
2008-04-20 16:41                           ` Jörn Engel
2008-04-20 17:19                             ` Andi Kleen
2008-04-20 17:43                               ` Jörn Engel
2008-04-20 18:19                                 ` Andi Kleen
2008-04-20 18:50                                   ` Arjan van de Ven
2008-04-20 20:09                                     ` Andi Kleen
2008-04-20 21:50                                     ` Andrew Morton
2008-04-20 21:55                                       ` Andi Kleen
2008-04-21 14:29                                       ` Ingo Molnar
2008-04-20 20:32                                   ` Jörn Engel
2008-04-20 20:35                                   ` Jörn Engel
2008-04-20 14:09                       ` Eric Sandeen
2008-04-20 14:20                         ` Willy Tarreau
2008-04-20 14:40                           ` Eric Sandeen
2008-04-20 15:44                   ` Daniel Hazelton
2008-04-20 17:26                     ` Andi Kleen
2008-04-20 18:48                       ` Arjan van de Ven
2008-04-20 20:01                         ` Andi Kleen
2008-04-20 20:43                           ` Daniel Hazelton
2008-04-20 21:40                             ` Andi Kleen
2008-04-20 22:17                               ` Bernd Eckenfels
2008-04-20 23:48                                 ` Avi Kivity
2008-04-21  1:45                               ` Daniel Hazelton
2008-04-21  7:51                                 ` Andi Kleen
2008-04-21 17:34                                   ` Daniel Hazelton
2008-04-20 22:33                           ` Arjan van de Ven
2008-04-20 22:33                           ` Arjan van de Ven
2008-04-20 23:16                             ` Andi Kleen
2008-04-21  5:53                               ` Arjan van de Ven
2008-04-21  3:06                             ` Eric Sandeen
2008-04-20 21:45                         ` Andrew Morton
2008-04-20 21:51                           ` Andi Kleen
2008-04-22 18:20                     ` Romano Giannetti
2008-04-23  5:03                       ` Denys Vlasenko
2008-04-23  5:21                         ` Daniel Hazelton
2008-04-23  5:25                           ` david
2008-04-23  5:41                             ` Daniel Hazelton
2008-04-23  7:46                               ` Romano Giannetti
2008-04-23 11:24                                 ` Stefan Richter
2008-04-23 12:15                                   ` Romano Giannetti
2008-04-23 15:59                                     ` Lennart Sorensen
2008-04-20 13:22                 ` Mark Lord
2008-04-19 17:49     ` Andrew Morton
2008-04-25 17:39       ` Parag Warudkar
2008-04-20  3:29     ` Eric Sandeen
2008-04-20 12:36       ` Andi Kleen
2008-04-21 14:31       ` Ingo Molnar
2008-04-23  5:27     ` Benjamin Herrenschmidt
2008-04-23 23:36       ` David Chinner
2008-04-24  0:45         ` Arjan van de Ven
2008-04-24  9:52           ` Christoph Hellwig
2008-04-24 12:25             ` Peter Zijlstra
2008-04-24 15:41             ` Chris Mason
2008-04-24 18:30               ` Alexander van Heukelum
2008-04-24  0:56         ` Benjamin Herrenschmidt

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=200804221532.22701.vda.linux@googlemail.com \
    --to=vda.linux@googlemail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjan@infradead.org \
    --cc=bunk@kernel.org \
    --cc=dgc@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sandeen@sandeen.net \
    --cc=shawn.bohrer@gmail.com \
    --cc=tglx@linutronix.de \
    /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