All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values
@ 2006-09-17  1:09 Josef 'Jeff' Sipek
  2006-09-17  1:09 ` [PATCH 1 of 11] MBCS: Use SEEK_{SET, CUR, END} " Josef 'Jeff' Sipek
                   ` (12 more replies)
  0 siblings, 13 replies; 20+ messages in thread
From: Josef 'Jeff' Sipek @ 2006-09-17  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, dhowells

In July, David Howells added SEEK_{SET,CUR,END} definitions to include/linux/fs.h

The following patches convert offenders which were found by grep'ing the source
tree.

Josef 'Jeff' Sipek

11 files changed, 34 insertions(+), 39 deletions(-)
drivers/char/mbcs.c                    |    7 ++++---
drivers/isdn/hardware/eicon/dsp_defs.h |    3 ---
drivers/mtd/mtdchar.c                  |   11 ++++-------
fs/cifs/cifsfs.c                       |    2 +-
fs/locks.c                             |   12 ++++++------
fs/nfs/file.c                          |    2 +-
fs/xfs/xfs_vnodeops.c                  |    6 +++---
sound/core/info.c                      |    6 +++---
sound/drivers/opl4/opl4_proc.c         |    6 +++---
sound/isa/gus/gus_mem_proc.c           |    6 +++---
sound/pci/mixart/mixart.c              |   12 ++++++------




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 1 of 11] MBCS: Use SEEK_{SET, CUR, END} instead of hardcoded values
  2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
@ 2006-09-17  1:09 ` Josef 'Jeff' Sipek
  2006-09-17  1:09 ` [PATCH 2 of 11] EICON ISDN: Removed unused definitions for OS_SEEK_* Josef 'Jeff' Sipek
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Josef 'Jeff' Sipek @ 2006-09-17  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, dhowells

MBCS: Use SEEK_{SET,CUR,END} instead of hardcoded values

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

--

diff -r abfba7cd6289 -r 115dd6f4c050 drivers/char/mbcs.c
--- a/drivers/char/mbcs.c	Sun Sep 17 02:54:32 2006 +0700
+++ b/drivers/char/mbcs.c	Sat Sep 16 21:00:45 2006 -0400
@@ -22,6 +22,7 @@
 #include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/mm.h>
+#include <linux/fs.h>
 #include <linux/uio.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -447,15 +448,15 @@ loff_t mbcs_sram_llseek(struct file * fi
 	loff_t newpos;
 
 	switch (whence) {
-	case 0:		/* SEEK_SET */
+	case SEEK_SET:
 		newpos = off;
 		break;
 
-	case 1:		/* SEEK_CUR */
+	case SEEK_CUR:
 		newpos = filp->f_pos + off;
 		break;
 
-	case 2:		/* SEEK_END */
+	case SEEK_END:
 		newpos = MBCS_SRAM_SIZE + off;
 		break;
 



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 2 of 11] EICON ISDN: Removed unused definitions for OS_SEEK_*
  2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
  2006-09-17  1:09 ` [PATCH 1 of 11] MBCS: Use SEEK_{SET, CUR, END} " Josef 'Jeff' Sipek
@ 2006-09-17  1:09 ` Josef 'Jeff' Sipek
  2006-09-17  8:48   ` Armin Schindler
  2006-09-17  1:09 ` [PATCH 3 of 11] MTD: Use SEEK_{SET, CUR, END} instead of hardcoded values Josef 'Jeff' Sipek
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Josef 'Jeff' Sipek @ 2006-09-17  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: kkeil, mac, akpm, dhowells

EICON ISDN: Removed unused definitions for OS_SEEK_*

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

--

diff -r 115dd6f4c050 -r e90cdef08ec3 drivers/isdn/hardware/eicon/dsp_defs.h
--- a/drivers/isdn/hardware/eicon/dsp_defs.h	Sat Sep 16 21:00:45 2006 -0400
+++ b/drivers/isdn/hardware/eicon/dsp_defs.h	Sat Sep 16 21:00:45 2006 -0400
@@ -34,9 +34,6 @@
  *
  * I/O functions returns -1 on error, 0 on EOF
  */
-#define OS_SEEK_SET 0
-#define OS_SEEK_CUR 1
-#define OS_SEEK_END 2
 struct _OsFileHandle_;
 typedef long (  * OsFileIo)  (struct _OsFileHandle_    *handle,
                                 void                     *buffer,



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 3 of 11] MTD: Use SEEK_{SET, CUR, END} instead of hardcoded values
  2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
  2006-09-17  1:09 ` [PATCH 1 of 11] MBCS: Use SEEK_{SET, CUR, END} " Josef 'Jeff' Sipek
  2006-09-17  1:09 ` [PATCH 2 of 11] EICON ISDN: Removed unused definitions for OS_SEEK_* Josef 'Jeff' Sipek
@ 2006-09-17  1:09 ` Josef 'Jeff' Sipek
  2006-09-17 16:06   ` David Woodhouse
  2006-09-17  1:09 ` [PATCH 4 of 11] CIFS: Use SEEK_END instead of hardcoded value Josef 'Jeff' Sipek
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Josef 'Jeff' Sipek @ 2006-09-17  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: dwmw2, akpm, dhowells

MTD: Use SEEK_{SET,CUR,END} instead of hardcoded values

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

--

diff -r e90cdef08ec3 -r 7d3e8ba1ace3 drivers/mtd/mtdchar.c
--- a/drivers/mtd/mtdchar.c	Sat Sep 16 21:00:45 2006 -0400
+++ b/drivers/mtd/mtdchar.c	Sat Sep 16 21:00:45 2006 -0400
@@ -62,15 +62,12 @@ static loff_t mtd_lseek (struct file *fi
 	struct mtd_info *mtd = mfi->mtd;
 
 	switch (orig) {
-	case 0:
-		/* SEEK_SET */
-		break;
-	case 1:
-		/* SEEK_CUR */
+	case SEEK_SET:
+		break;
+	case SEEK_CUR:
 		offset += file->f_pos;
 		break;
-	case 2:
-		/* SEEK_END */
+	case SEEK_END:
 		offset += mtd->size;
 		break;
 	default:



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 4 of 11] CIFS: Use SEEK_END instead of hardcoded value
  2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
                   ` (2 preceding siblings ...)
  2006-09-17  1:09 ` [PATCH 3 of 11] MTD: Use SEEK_{SET, CUR, END} instead of hardcoded values Josef 'Jeff' Sipek
@ 2006-09-17  1:09 ` Josef 'Jeff' Sipek
  2006-09-17  1:09 ` [PATCH 5 of 11] XFS: Use SEEK_{SET, CUR, END} instead of hardcoded values Josef 'Jeff' Sipek
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Josef 'Jeff' Sipek @ 2006-09-17  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: sfrench, akpm, dhowells

CIFS: Use SEEK_END instead of hardcoded value

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

--

diff -r 7d3e8ba1ace3 -r e2fae9fe7a30 fs/cifs/cifsfs.c
--- a/fs/cifs/cifsfs.c	Sat Sep 16 21:00:45 2006 -0400
+++ b/fs/cifs/cifsfs.c	Sat Sep 16 21:00:45 2006 -0400
@@ -510,7 +510,7 @@ static loff_t cifs_llseek(struct file *f
 static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
 {
 	/* origin == SEEK_END => we must revalidate the cached file length */
-	if (origin == 2) {
+	if (origin == SEEK_END) {
 		int retval = cifs_revalidate(file->f_dentry);
 		if (retval < 0)
 			return (loff_t)retval;



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 5 of 11] XFS: Use SEEK_{SET, CUR, END} instead of hardcoded values
  2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
                   ` (3 preceding siblings ...)
  2006-09-17  1:09 ` [PATCH 4 of 11] CIFS: Use SEEK_END instead of hardcoded value Josef 'Jeff' Sipek
@ 2006-09-17  1:09 ` Josef 'Jeff' Sipek
  2006-09-18  3:34   ` David Chinner
  2006-09-17  1:09 ` [PATCH 6 of 11] NFS: Use SEEK_END instead of hardcoded value Josef 'Jeff' Sipek
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Josef 'Jeff' Sipek @ 2006-09-17  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: xfs-masters, akpm, dhowells

XFS: Use SEEK_{SET,CUR,END} instead of hardcoded values

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

--

diff -r e2fae9fe7a30 -r 4cdee5980dad fs/xfs/xfs_vnodeops.c
--- a/fs/xfs/xfs_vnodeops.c	Sat Sep 16 21:00:45 2006 -0400
+++ b/fs/xfs/xfs_vnodeops.c	Sat Sep 16 21:00:45 2006 -0400
@@ -4510,12 +4510,12 @@ xfs_change_file_space(
 	xfs_iunlock(ip, XFS_ILOCK_SHARED);
 
 	switch (bf->l_whence) {
-	case 0: /*SEEK_SET*/
+	case SEEK_SET:
 		break;
-	case 1: /*SEEK_CUR*/
+	case SEEK_CUR:
 		bf->l_start += offset;
 		break;
-	case 2: /*SEEK_END*/
+	case SEEK_END:
 		bf->l_start += ip->i_d.di_size;
 		break;
 	default:



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 6 of 11] NFS: Use SEEK_END instead of hardcoded value
  2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
                   ` (4 preceding siblings ...)
  2006-09-17  1:09 ` [PATCH 5 of 11] XFS: Use SEEK_{SET, CUR, END} instead of hardcoded values Josef 'Jeff' Sipek
@ 2006-09-17  1:09 ` Josef 'Jeff' Sipek
  2006-09-17  1:09 ` [PATCH 7 of 11] VFS: Use SEEK_{SET, CUR, END} instead of hardcoded values Josef 'Jeff' Sipek
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Josef 'Jeff' Sipek @ 2006-09-17  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: neilb, trond.myklebust, akpm, dhowells

NFS: Use SEEK_END instead of hardcoded value

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

--

diff -r 4cdee5980dad -r ca33dbd739b3 fs/nfs/file.c
--- a/fs/nfs/file.c	Sat Sep 16 21:00:45 2006 -0400
+++ b/fs/nfs/file.c	Sat Sep 16 21:00:45 2006 -0400
@@ -157,7 +157,7 @@ static loff_t nfs_file_llseek(struct fil
 static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
 {
 	/* origin == SEEK_END => we must revalidate the cached file length */
-	if (origin == 2) {
+	if (origin == SEEK_END) {
 		struct inode *inode = filp->f_mapping->host;
 		int retval = nfs_revalidate_file_size(inode, filp);
 		if (retval < 0)



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 7 of 11] VFS: Use SEEK_{SET, CUR, END} instead of hardcoded values
  2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
                   ` (5 preceding siblings ...)
  2006-09-17  1:09 ` [PATCH 6 of 11] NFS: Use SEEK_END instead of hardcoded value Josef 'Jeff' Sipek
@ 2006-09-17  1:09 ` Josef 'Jeff' Sipek
  2006-09-17  1:09 ` [PATCH 8 of 11] sound core: " Josef 'Jeff' Sipek
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Josef 'Jeff' Sipek @ 2006-09-17  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: viro, hch, akpm, dhowells

VFS: Use SEEK_{SET,CUR,END} instead of hardcoded values

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

--

diff -r ca33dbd739b3 -r 1622a39ffb54 fs/locks.c
--- a/fs/locks.c	Sat Sep 16 21:00:45 2006 -0400
+++ b/fs/locks.c	Sat Sep 16 21:00:45 2006 -0400
@@ -314,13 +314,13 @@ static int flock_to_posix_lock(struct fi
 	off_t start, end;
 
 	switch (l->l_whence) {
-	case 0: /*SEEK_SET*/
+	case SEEK_SET:
 		start = 0;
 		break;
-	case 1: /*SEEK_CUR*/
+	case SEEK_CUR:
 		start = filp->f_pos;
 		break;
-	case 2: /*SEEK_END*/
+	case SEEK_END:
 		start = i_size_read(filp->f_dentry->d_inode);
 		break;
 	default:
@@ -364,13 +364,13 @@ static int flock64_to_posix_lock(struct 
 	loff_t start;
 
 	switch (l->l_whence) {
-	case 0: /*SEEK_SET*/
+	case SEEK_SET:
 		start = 0;
 		break;
-	case 1: /*SEEK_CUR*/
+	case SEEK_CUR:
 		start = filp->f_pos;
 		break;
-	case 2: /*SEEK_END*/
+	case SEEK_END:
 		start = i_size_read(filp->f_dentry->d_inode);
 		break;
 	default:



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 8 of 11] sound core: Use SEEK_{SET, CUR, END} instead of hardcoded values
  2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
                   ` (6 preceding siblings ...)
  2006-09-17  1:09 ` [PATCH 7 of 11] VFS: Use SEEK_{SET, CUR, END} instead of hardcoded values Josef 'Jeff' Sipek
@ 2006-09-17  1:09 ` Josef 'Jeff' Sipek
  2006-09-17  1:09 ` [PATCH 9 of 11] opl4: " Josef 'Jeff' Sipek
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Josef 'Jeff' Sipek @ 2006-09-17  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: perex, akpm, dhowells

sound core: Use SEEK_{SET,CUR,END} instead of hardcoded values

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

--

diff -r 1622a39ffb54 -r 7e68f25a3e0c sound/core/info.c
--- a/sound/core/info.c	Sat Sep 16 21:00:45 2006 -0400
+++ b/sound/core/info.c	Sat Sep 16 21:00:45 2006 -0400
@@ -174,15 +174,15 @@ static loff_t snd_info_entry_llseek(stru
 	switch (entry->content) {
 	case SNDRV_INFO_CONTENT_TEXT:
 		switch (orig) {
-		case 0:	/* SEEK_SET */
+		case SEEK_SET:
 			file->f_pos = offset;
 			ret = file->f_pos;
 			goto out;
-		case 1:	/* SEEK_CUR */
+		case SEEK_CUR:
 			file->f_pos += offset;
 			ret = file->f_pos;
 			goto out;
-		case 2:	/* SEEK_END */
+		case SEEK_END:
 		default:
 			ret = -EINVAL;
 			goto out;



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 9 of 11] opl4: Use SEEK_{SET, CUR, END} instead of hardcoded values
  2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
                   ` (7 preceding siblings ...)
  2006-09-17  1:09 ` [PATCH 8 of 11] sound core: " Josef 'Jeff' Sipek
@ 2006-09-17  1:09 ` Josef 'Jeff' Sipek
  2006-09-17  1:09 ` [PATCH 10 of 11] gus: " Josef 'Jeff' Sipek
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Josef 'Jeff' Sipek @ 2006-09-17  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: perex, akpm, dhowells

opl4: Use SEEK_{SET,CUR,END} instead of hardcoded values

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

--

diff -r 7e68f25a3e0c -r 057a40d60798 sound/drivers/opl4/opl4_proc.c
--- a/sound/drivers/opl4/opl4_proc.c	Sat Sep 16 21:00:45 2006 -0400
+++ b/sound/drivers/opl4/opl4_proc.c	Sat Sep 16 21:00:46 2006 -0400
@@ -105,13 +105,13 @@ static long long snd_opl4_mem_proc_llsee
 					  struct file *file, long long offset, int orig)
 {
 	switch (orig) {
-	case 0: /* SEEK_SET */
+	case SEEK_SET:
 		file->f_pos = offset;
 		break;
-	case 1: /* SEEK_CUR */
+	case SEEK_CUR:
 		file->f_pos += offset;
 		break;
-	case 2: /* SEEK_END, offset is negative */
+	case SEEK_END: /* offset is negative */
 		file->f_pos = entry->size + offset;
 		break;
 	default:



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 10 of 11] gus: Use SEEK_{SET, CUR, END} instead of hardcoded values
  2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
                   ` (8 preceding siblings ...)
  2006-09-17  1:09 ` [PATCH 9 of 11] opl4: " Josef 'Jeff' Sipek
@ 2006-09-17  1:09 ` Josef 'Jeff' Sipek
  2006-09-17  1:09 ` [PATCH 11 of 11] mixart: " Josef 'Jeff' Sipek
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Josef 'Jeff' Sipek @ 2006-09-17  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: perex, akpm, dhowells

gus: Use SEEK_{SET,CUR,END} instead of hardcoded values

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

--

diff -r 057a40d60798 -r f255d0d208e7 sound/isa/gus/gus_mem_proc.c
--- a/sound/isa/gus/gus_mem_proc.c	Sat Sep 16 21:00:46 2006 -0400
+++ b/sound/isa/gus/gus_mem_proc.c	Sat Sep 16 21:00:46 2006 -0400
@@ -61,13 +61,13 @@ static long long snd_gf1_mem_proc_llseek
 	struct gus_proc_private *priv = entry->private_data;
 
 	switch (orig) {
-	case 0:	/* SEEK_SET */
+	case SEEK_SET:
 		file->f_pos = offset;
 		break;
-	case 1:	/* SEEK_CUR */
+	case SEEK_CUR:
 		file->f_pos += offset;
 		break;
-	case 2: /* SEEK_END, offset is negative */
+	case SEEK_END: /* offset is negative */
 		file->f_pos = priv->size + offset;
 		break;
 	default:



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 11 of 11] mixart: Use SEEK_{SET, CUR, END} instead of hardcoded values
  2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
                   ` (9 preceding siblings ...)
  2006-09-17  1:09 ` [PATCH 10 of 11] gus: " Josef 'Jeff' Sipek
@ 2006-09-17  1:09 ` Josef 'Jeff' Sipek
  2006-09-17  3:46 ` [PATCH 0 of 11] Use SEEK_{SET,CUR,END} " Nick Piggin
  2006-09-18 10:32 ` David Howells
  12 siblings, 0 replies; 20+ messages in thread
From: Josef 'Jeff' Sipek @ 2006-09-17  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: perex, akpm, dhowells

mixart: Use SEEK_{SET,CUR,END} instead of hardcoded values

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

--

diff -r f255d0d208e7 -r 9ef3df8b70fe sound/pci/mixart/mixart.c
--- a/sound/pci/mixart/mixart.c	Sat Sep 16 21:00:46 2006 -0400
+++ b/sound/pci/mixart/mixart.c	Sat Sep 16 21:00:46 2006 -0400
@@ -1109,13 +1109,13 @@ static long long snd_mixart_BA0_llseek(s
 	offset = offset & ~3; /* 4 bytes aligned */
 
 	switch(orig) {
-	case 0:  /* SEEK_SET */
+	case SEEK_SET:
 		file->f_pos = offset;
 		break;
-	case 1:  /* SEEK_CUR */
+	case SEEK_CUR:
 		file->f_pos += offset;
 		break;
-	case 2:  /* SEEK_END, offset is negative */
+	case SEEK_END: /* offset is negative */
 		file->f_pos = MIXART_BA0_SIZE + offset;
 		break;
 	default:
@@ -1135,13 +1135,13 @@ static long long snd_mixart_BA1_llseek(s
 	offset = offset & ~3; /* 4 bytes aligned */
 
 	switch(orig) {
-	case 0:  /* SEEK_SET */
+	case SEEK_SET:
 		file->f_pos = offset;
 		break;
-	case 1:  /* SEEK_CUR */
+	case SEEK_CUR:
 		file->f_pos += offset;
 		break;
-	case 2: /* SEEK_END, offset is negative */
+	case SEEK_END: /* offset is negative */
 		file->f_pos = MIXART_BA1_SIZE + offset;
 		break;
 	default:



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values
  2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
                   ` (10 preceding siblings ...)
  2006-09-17  1:09 ` [PATCH 11 of 11] mixart: " Josef 'Jeff' Sipek
@ 2006-09-17  3:46 ` Nick Piggin
  2006-09-17  6:38   ` Josef Sipek
  2006-09-18 10:32 ` David Howells
  12 siblings, 1 reply; 20+ messages in thread
From: Nick Piggin @ 2006-09-17  3:46 UTC (permalink / raw)
  To: Josef 'Jeff' Sipek; +Cc: linux-kernel, akpm, dhowells

Josef 'Jeff' Sipek wrote:
> In July, David Howells added SEEK_{SET,CUR,END} definitions to include/linux/fs.h
> 
> The following patches convert offenders which were found by grep'ing the source
> tree.

Looks like a good change to me.

Nitpick, do you need 11 patches to do it? 1 would be fine, I think?

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values
  2006-09-17  3:46 ` [PATCH 0 of 11] Use SEEK_{SET,CUR,END} " Nick Piggin
@ 2006-09-17  6:38   ` Josef Sipek
  0 siblings, 0 replies; 20+ messages in thread
From: Josef Sipek @ 2006-09-17  6:38 UTC (permalink / raw)
  To: Nick Piggin; +Cc: linux-kernel, akpm, dhowells

On Sun, Sep 17, 2006 at 01:46:23PM +1000, Nick Piggin wrote:
> Josef 'Jeff' Sipek wrote:
> >In July, David Howells added SEEK_{SET,CUR,END} definitions to 
> >include/linux/fs.h
> >
> >The following patches convert offenders which were found by grep'ing the 
> >source
> >tree.
> 
> Looks like a good change to me.
> 
> Nitpick, do you need 11 patches to do it? 1 would be fine, I think?

I don't. I just got carried away with Mercurial's patch queues support.

Josef 'Jeff' Sipek.

-- 
A computer without Microsoft is like chocolate cake without mustard.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2 of 11] EICON ISDN: Removed unused definitions for OS_SEEK_*
  2006-09-17  1:09 ` [PATCH 2 of 11] EICON ISDN: Removed unused definitions for OS_SEEK_* Josef 'Jeff' Sipek
@ 2006-09-17  8:48   ` Armin Schindler
  0 siblings, 0 replies; 20+ messages in thread
From: Armin Schindler @ 2006-09-17  8:48 UTC (permalink / raw)
  To: Josef 'Jeff' Sipek; +Cc: linux-kernel, kkeil, akpm, dhowells


Agreed, these defines are not used in the linux kernel. They can be removed.

Armin

On Sat, 16 Sep 2006, Josef 'Jeff' Sipek wrote:
> EICON ISDN: Removed unused definitions for OS_SEEK_*

Acked-by: Armin Schindler <armin@melware.de> 
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

--
 
diff -r 115dd6f4c050 -r e90cdef08ec3 drivers/isdn/hardware/eicon/dsp_defs.h
--- a/drivers/isdn/hardware/eicon/dsp_defs.h	Sat Sep 16 21:00:45 2006 -0400
+++ b/drivers/isdn/hardware/eicon/dsp_defs.h	Sat Sep 16 21:00:45 2006 -0400
@@ -34,9 +34,6 @@
  *
  * I/O functions returns -1 on error, 0 on EOF
  */
-#define OS_SEEK_SET 0
-#define OS_SEEK_CUR 1
-#define OS_SEEK_END 2
 struct _OsFileHandle_;
 typedef long (  * OsFileIo)  (struct _OsFileHandle_    *handle,
                                 void                     *buffer,



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3 of 11] MTD: Use SEEK_{SET, CUR, END} instead of hardcoded values
  2006-09-17  1:09 ` [PATCH 3 of 11] MTD: Use SEEK_{SET, CUR, END} instead of hardcoded values Josef 'Jeff' Sipek
@ 2006-09-17 16:06   ` David Woodhouse
  0 siblings, 0 replies; 20+ messages in thread
From: David Woodhouse @ 2006-09-17 16:06 UTC (permalink / raw)
  To: Josef 'Jeff' Sipek; +Cc: linux-kernel, akpm, dhowells

On Sat, 2006-09-16 at 21:09 -0400, Josef 'Jeff' Sipek wrote:
> MTD: Use SEEK_{SET,CUR,END} instead of hardcoded values
> 
> Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

Applied to MTD git tree; thanks.

-- 
dwmw2


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 5 of 11] XFS: Use SEEK_{SET, CUR, END} instead of hardcoded values
  2006-09-17  1:09 ` [PATCH 5 of 11] XFS: Use SEEK_{SET, CUR, END} instead of hardcoded values Josef 'Jeff' Sipek
@ 2006-09-18  3:34   ` David Chinner
  2006-09-18 10:30     ` David Howells
  0 siblings, 1 reply; 20+ messages in thread
From: David Chinner @ 2006-09-18  3:34 UTC (permalink / raw)
  To: Josef 'Jeff' Sipek; +Cc: linux-kernel, xfs-masters, akpm, dhowells

On Sat, Sep 16, 2006 at 09:09:31PM -0400, Josef 'Jeff' Sipek wrote:
> XFS: Use SEEK_{SET,CUR,END} instead of hardcoded values

The hard coded values  used in xfs_change_file_space() are documented as part
of the API to the userspace functions that use this interface in xfsctl(3).
That is:

  XFS_IOC_FREESP
  XFS_IOC_FREESP64
  XFS_IOC_ALLOCSP
  XFS_IOC_ALLOCSP64

  Alter storage space associated with a section of the ordinary file specified.
  The section is specified by a variable of type  xfs_flock64_t,  pointed  to  by
  the  final argument.  The data type xfs_flock64_t contains the following
  members: l_whence is 0, 1, or 2 to indicate that the relative offset l_start
  will be measured from the start  of  the  file,  the current  position, or the
  end of the file, respectively.

Hence I think that the hard coded values should not be changed to something
that is defined outside of XFS's API.

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 5 of 11] XFS: Use SEEK_{SET, CUR, END} instead of hardcoded values
  2006-09-18  3:34   ` David Chinner
@ 2006-09-18 10:30     ` David Howells
  2006-09-19  4:01       ` David Chinner
  0 siblings, 1 reply; 20+ messages in thread
From: David Howells @ 2006-09-18 10:30 UTC (permalink / raw)
  To: David Chinner
  Cc: Josef 'Jeff' Sipek, linux-kernel, xfs-masters, akpm,
	dhowells

David Chinner <dgc@sgi.com> wrote:

> The hard coded values  used in xfs_change_file_space() are documented as part
> of the API to the userspace functions that use this interface in xfsctl(3).

Hmmm... that's a good point.  I think you're right on this account, and so the
comments in:

		case 0: /*SEEK_SET*/
			break;
		case 1: /*SEEK_CUR*/
			bf->l_start += offset;
			break;
		case 2: /*SEEK_END*/
			bf->l_start += ip->i_d.di_size;
			break;

should be stripped off as they are not exactly correct.

David

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values
  2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
                   ` (11 preceding siblings ...)
  2006-09-17  3:46 ` [PATCH 0 of 11] Use SEEK_{SET,CUR,END} " Nick Piggin
@ 2006-09-18 10:32 ` David Howells
  12 siblings, 0 replies; 20+ messages in thread
From: David Howells @ 2006-09-18 10:32 UTC (permalink / raw)
  To: Josef 'Jeff' Sipek; +Cc: linux-kernel, akpm, dhowells

Josef 'Jeff' Sipek <jeffpc@josefsipek.net> wrote:

> In July, David Howells added SEEK_{SET,CUR,END} definitions to
> include/linux/fs.h
> 
> The following patches convert offenders which were found by grep'ing the
> source tree.

Looks good, though I think you do have to drop the XFS portion of the patch,
though you could strip the comments from the case statements there.

So NAK for the XFS patch, but for the rest:

Acked-By: David Howells <dhowells@redhat.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 5 of 11] XFS: Use SEEK_{SET, CUR, END} instead of hardcoded values
  2006-09-18 10:30     ` David Howells
@ 2006-09-19  4:01       ` David Chinner
  0 siblings, 0 replies; 20+ messages in thread
From: David Chinner @ 2006-09-19  4:01 UTC (permalink / raw)
  To: David Howells
  Cc: David Chinner, Josef 'Jeff' Sipek, linux-kernel,
	xfs-masters, akpm

On Mon, Sep 18, 2006 at 11:30:35AM +0100, David Howells wrote:
> David Chinner <dgc@sgi.com> wrote:
> 
> > The hard coded values  used in xfs_change_file_space() are documented as part
> > of the API to the userspace functions that use this interface in xfsctl(3).
> 
> Hmmm... that's a good point.  I think you're right on this account, and so the
> comments in:
> 
> 		case 0: /*SEEK_SET*/
> 			break;
> 		case 1: /*SEEK_CUR*/
> 			bf->l_start += offset;
> 			break;
> 		case 2: /*SEEK_END*/
> 			bf->l_start += ip->i_d.di_size;
> 			break;
> 
> should be stripped off as they are not exactly correct.

Sure, they're not _exactly_ the same as seek semantics, but the
comment is informative enough to tell you what the magic numbers
are supposed to mean as you read the code.

If you really want to strip these out these comments, can you please
replace them with a new comment that documents the magic number
behaviour?

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2006-09-19  4:01 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-17  1:09 [PATCH 0 of 11] Use SEEK_{SET,CUR,END} instead of hardcoded values Josef 'Jeff' Sipek
2006-09-17  1:09 ` [PATCH 1 of 11] MBCS: Use SEEK_{SET, CUR, END} " Josef 'Jeff' Sipek
2006-09-17  1:09 ` [PATCH 2 of 11] EICON ISDN: Removed unused definitions for OS_SEEK_* Josef 'Jeff' Sipek
2006-09-17  8:48   ` Armin Schindler
2006-09-17  1:09 ` [PATCH 3 of 11] MTD: Use SEEK_{SET, CUR, END} instead of hardcoded values Josef 'Jeff' Sipek
2006-09-17 16:06   ` David Woodhouse
2006-09-17  1:09 ` [PATCH 4 of 11] CIFS: Use SEEK_END instead of hardcoded value Josef 'Jeff' Sipek
2006-09-17  1:09 ` [PATCH 5 of 11] XFS: Use SEEK_{SET, CUR, END} instead of hardcoded values Josef 'Jeff' Sipek
2006-09-18  3:34   ` David Chinner
2006-09-18 10:30     ` David Howells
2006-09-19  4:01       ` David Chinner
2006-09-17  1:09 ` [PATCH 6 of 11] NFS: Use SEEK_END instead of hardcoded value Josef 'Jeff' Sipek
2006-09-17  1:09 ` [PATCH 7 of 11] VFS: Use SEEK_{SET, CUR, END} instead of hardcoded values Josef 'Jeff' Sipek
2006-09-17  1:09 ` [PATCH 8 of 11] sound core: " Josef 'Jeff' Sipek
2006-09-17  1:09 ` [PATCH 9 of 11] opl4: " Josef 'Jeff' Sipek
2006-09-17  1:09 ` [PATCH 10 of 11] gus: " Josef 'Jeff' Sipek
2006-09-17  1:09 ` [PATCH 11 of 11] mixart: " Josef 'Jeff' Sipek
2006-09-17  3:46 ` [PATCH 0 of 11] Use SEEK_{SET,CUR,END} " Nick Piggin
2006-09-17  6:38   ` Josef Sipek
2006-09-18 10:32 ` David Howells

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.