All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcin Slusarz <marcin.slusarz@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 5/6] udf: remove unneeded kernel_timestamp type
Date: Sun, 10 Feb 2008 11:29:10 +0100	[thread overview]
Message-ID: <20080210102900.GF6737@joi> (raw)
In-Reply-To: <20080205160115.GJ25464@duck.suse.cz>

On Tue, Feb 05, 2008 at 05:01:15PM +0100, Jan Kara wrote:
> On Sun 03-02-08 19:36:10, marcin.slusarz@gmail.com wrote:
> > remove now unneeded kernel_timestamp type with conversion functions
>   OK. Acked-by: Jan Kara <jack@suse.cz>
updated version which aplies after changes to patch:
udf: convert udf_stamp_to_time and udf_time_to_stamp to use timestamps

---
udf: remove unneeded kernel_timestamp type

remove now unneeded kernel_timestamp type with conversion functions

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: Jan Kara <jack@suse.cz>
---
 fs/udf/ecma_167.h |   13 -------------
 fs/udf/super.c    |    9 +++++----
 fs/udf/udfend.h   |   22 ----------------------
 3 files changed, 5 insertions(+), 39 deletions(-)

diff --git a/fs/udf/ecma_167.h b/fs/udf/ecma_167.h
index 5638771..a0974df 100644
--- a/fs/udf/ecma_167.h
+++ b/fs/udf/ecma_167.h
@@ -70,19 +70,6 @@ typedef struct {
 	uint8_t		microseconds;
 } __attribute__ ((packed)) timestamp;
 
-typedef struct {
-	uint16_t	typeAndTimezone;
-	int16_t		year;
-	uint8_t		month;
-	uint8_t		day;
-	uint8_t		hour;
-	uint8_t		minute;
-	uint8_t		second;
-	uint8_t		centiseconds;
-	uint8_t		hundredsOfMicroseconds;
-	uint8_t		microseconds;
-} __attribute__ ((packed)) kernel_timestamp;
-
 /* Type and Time Zone (ECMA 167r3 1/7.3.1) */
 #define TIMESTAMP_TYPE_MASK		0xF000
 #define TIMESTAMP_TYPE_CUT		0x0000
diff --git a/fs/udf/super.c b/fs/udf/super.c
index ab63dbb..56d9efb 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -982,12 +982,13 @@ static void udf_load_pvoldesc(struct super_block *sb, struct buffer_head *bh)
 
 	if (udf_disk_stamp_to_time(&UDF_SB(sb)->s_record_time,
 			      pvoldesc->recordingDateAndTime)) {
-		kernel_timestamp ts;
-		ts = lets_to_cpu(pvoldesc->recordingDateAndTime);
+#ifdef UDFFS_DEBUG
+		timestamp *ts = &pvoldesc->recordingDateAndTime;
 		udf_debug("recording time %04u/%02u/%02u"
 			  " %02u:%02u (%x)\n",
-			  ts.year, ts.month, ts.day, ts.hour,
-			  ts.minute, ts.typeAndTimezone);
+			  le16_to_cpu(ts->year), ts->month, ts->day, ts->hour,
+			  ts->minute, le16_to_cpu(ts->typeAndTimezone));
+#endif
 	}
 
 	if (!udf_build_ustr(&instr, pvoldesc->volIdent, 32))
diff --git a/fs/udf/udfend.h b/fs/udf/udfend.h
index c4bd120..489f52f 100644
--- a/fs/udf/udfend.h
+++ b/fs/udf/udfend.h
@@ -24,17 +24,6 @@ static inline lb_addr cpu_to_lelb(kernel_lb_addr in)
 	return out;
 }
 
-static inline kernel_timestamp lets_to_cpu(timestamp in)
-{
-	kernel_timestamp out;
-
-	memcpy(&out, &in, sizeof(timestamp));
-	out.typeAndTimezone = le16_to_cpu(in.typeAndTimezone);
-	out.year = le16_to_cpu(in.year);
-
-	return out;
-}
-
 static inline short_ad lesa_to_cpu(short_ad in)
 {
 	short_ad out;
@@ -85,15 +74,4 @@ static inline kernel_extent_ad leea_to_cpu(extent_ad in)
 	return out;
 }
 
-static inline timestamp cpu_to_lets(kernel_timestamp in)
-{
-	timestamp out;
-
-	memcpy(&out, &in, sizeof(timestamp));
-	out.typeAndTimezone = cpu_to_le16(in.typeAndTimezone);
-	out.year = cpu_to_le16(in.year);
-
-	return out;
-}
-
 #endif /* __UDF_ENDIAN_H */
-- 
1.5.3.7


  reply	other threads:[~2008-02-10 10:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-03 18:36 [PATCH 0/6] udf: next round of cleanups marcin.slusarz
2008-02-03 18:36 ` [PATCH 1/6] udf: udf_get_block, inode_bmap - remove unneeded checks marcin.slusarz
2008-02-05 15:30   ` Jan Kara
2008-02-03 18:36 ` [PATCH 2/6] udf: create function for conversion from timestamp to timespec marcin.slusarz
2008-02-05 15:32   ` Jan Kara
2008-02-03 18:36 ` [PATCH 3/6] udf: convert udf_stamp_to_time to return struct timespec marcin.slusarz
2008-02-05 15:48   ` Jan Kara
2008-02-05 19:12     ` Marcin Slusarz
2008-02-06 13:25       ` Jan Kara
2008-02-03 18:36 ` [PATCH 4/6] udf: convert udf_stamp_to_time and udf_time_to_stamp to use timestamps marcin.slusarz
2008-02-05 15:59   ` Jan Kara
2008-02-05 19:21     ` Marcin Slusarz
2008-02-06 11:10       ` Jan Kara
2008-02-10 10:25         ` Marcin Slusarz
2008-02-03 18:36 ` [PATCH 5/6] udf: remove unneeded kernel_timestamp type marcin.slusarz
2008-02-05 16:01   ` Jan Kara
2008-02-10 10:29     ` Marcin Slusarz [this message]
2008-02-03 18:42 ` [PATCH 6/6] udf: super.c reorganization Marcin Slusarz
2008-02-05 16:22   ` Jan Kara
2008-02-05 19:34     ` Marcin Slusarz
2008-02-06 11:09       ` Jan Kara
2008-02-10 10:33         ` Marcin Slusarz

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=20080210102900.GF6737@joi \
    --to=marcin.slusarz@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.