* [PATCH 1/3] sg: kill unused SZ_SG_IOVEC define
@ 2009-03-11 1:02 FUJITA Tomonori
2009-03-11 1:02 ` [PATCH 2/3] sg: remove unnecessary type casts FUJITA Tomonori
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: FUJITA Tomonori @ 2009-03-11 1:02 UTC (permalink / raw)
To: James.Bottomley; +Cc: dgilbert, linux-scsi, FUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
drivers/scsi/sg.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 17d1bd5..e84536b 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -204,7 +204,6 @@ static void sg_put_dev(Sg_device *sdp);
#define SZ_SG_HEADER sizeof(struct sg_header)
#define SZ_SG_IO_HDR sizeof(sg_io_hdr_t)
-#define SZ_SG_IOVEC sizeof(sg_iovec_t)
#define SZ_SG_REQ_INFO sizeof(sg_req_info_t)
static int sg_allow_access(struct file *filp, unsigned char *cmd)
--
1.6.0.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] sg: remove unnecessary type casts
2009-03-11 1:02 [PATCH 1/3] sg: kill unused SZ_SG_IOVEC define FUJITA Tomonori
@ 2009-03-11 1:02 ` FUJITA Tomonori
2009-03-11 1:02 ` [PATCH 3/3] sg: remove unnecessary forward declaration FUJITA Tomonori
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: FUJITA Tomonori @ 2009-03-11 1:02 UTC (permalink / raw)
To: James.Bottomley; +Cc: dgilbert, linux-scsi, FUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
drivers/scsi/sg.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index e84536b..7d713a0 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -208,7 +208,7 @@ static void sg_put_dev(Sg_device *sdp);
static int sg_allow_access(struct file *filp, unsigned char *cmd)
{
- struct sg_fd *sfp = (struct sg_fd *)filp->private_data;
+ struct sg_fd *sfp = filp->private_data;
struct request_queue *q = sfp->parentdp->device->request_queue;
if (sfp->parentdp->device->type == TYPE_SCANNER)
@@ -319,7 +319,7 @@ sg_release(struct inode *inode, struct file *filp)
Sg_device *sdp;
Sg_fd *sfp;
- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;
SCSI_LOG_TIMEOUT(3, printk("sg_release: %s\n", sdp->disk->disk_name));
@@ -343,7 +343,7 @@ sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
struct sg_header *old_hdr = NULL;
int retval = 0;
- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;
SCSI_LOG_TIMEOUT(3, printk("sg_read: %s, count=%d\n",
sdp->disk->disk_name, (int) count));
@@ -534,7 +534,7 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
sg_io_hdr_t *hp;
unsigned char cmnd[MAX_COMMAND_SIZE];
- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;
SCSI_LOG_TIMEOUT(3, printk("sg_write: %s, count=%d\n",
sdp->disk->disk_name, (int) count));
@@ -770,7 +770,7 @@ sg_ioctl(struct inode *inode, struct file *filp,
Sg_request *srp;
unsigned long iflags;
- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;
SCSI_LOG_TIMEOUT(3, printk("sg_ioctl: %s, cmd=0x%x\n",
@@ -1085,7 +1085,7 @@ static long sg_compat_ioctl(struct file *filp, unsigned int cmd_in, unsigned lon
Sg_fd *sfp;
struct scsi_device *sdev;
- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;
sdev = sdp->device;
@@ -1111,7 +1111,7 @@ sg_poll(struct file *filp, poll_table * wait)
int count = 0;
unsigned long iflags;
- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp))
|| sfp->closed)
return POLLERR;
poll_wait(filp, &sfp->read_wait, wait);
@@ -1143,7 +1143,7 @@ sg_fasync(int fd, struct file *filp, int mode)
Sg_device *sdp;
Sg_fd *sfp;
- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;
SCSI_LOG_TIMEOUT(3, printk("sg_fasync: %s, mode=%d\n",
sdp->disk->disk_name, mode));
@@ -1160,7 +1160,7 @@ sg_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
Sg_scatter_hold *rsv_schp;
int k, length;
- if ((NULL == vma) || (!(sfp = (Sg_fd *) vma->vm_private_data)))
+ if ((NULL == vma) || (!(sfp = vma->vm_private_data)))
return VM_FAULT_SIGBUS;
rsv_schp = &sfp->reserve;
offset = vmf->pgoff << PAGE_SHIFT;
@@ -1199,7 +1199,7 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma)
Sg_scatter_hold *rsv_schp;
int k, length;
- if ((!filp) || (!vma) || (!(sfp = (Sg_fd *) filp->private_data)))
+ if ((!filp) || (!vma) || (!(sfp = filp->private_data)))
return -ENXIO;
req_sz = vma->vm_end - vma->vm_start;
SCSI_LOG_TIMEOUT(3, printk("sg_mmap starting, vm_start=%p, len=%d\n",
--
1.6.0.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] sg: remove unnecessary forward declaration
2009-03-11 1:02 [PATCH 1/3] sg: kill unused SZ_SG_IOVEC define FUJITA Tomonori
2009-03-11 1:02 ` [PATCH 2/3] sg: remove unnecessary type casts FUJITA Tomonori
@ 2009-03-11 1:02 ` FUJITA Tomonori
2009-04-01 14:03 ` [PATCH 1/3] sg: kill unused SZ_SG_IOVEC define FUJITA Tomonori
2009-04-01 16:40 ` Douglas Gilbert
3 siblings, 0 replies; 5+ messages in thread
From: FUJITA Tomonori @ 2009-03-11 1:02 UTC (permalink / raw)
To: James.Bottomley; +Cc: dgilbert, linux-scsi, FUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
drivers/scsi/sg.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 7d713a0..24f09ea 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -99,17 +99,9 @@ static int scatter_elem_sz_prev = SG_SCATTER_SZ;
#define SG_SECTOR_SZ 512
-static int sg_add(struct device *, struct class_interface *);
-static void sg_remove(struct device *, struct class_interface *);
-
static DEFINE_IDR(sg_index_idr);
-static DEFINE_RWLOCK(sg_index_lock); /* Also used to lock
- file descriptor list for device */
-
-static struct class_interface sg_interface = {
- .add_dev = sg_add,
- .remove_dev = sg_remove,
-};
+/* Also used to lock file descriptor list for device */
+static DEFINE_RWLOCK(sg_index_lock);
typedef struct sg_scatter_hold { /* holding area for scsi scatter gather info */
unsigned short k_use_sg; /* Count of kernel scatter-gather pieces */
@@ -1531,6 +1523,11 @@ static void sg_remove(struct device *cl_dev, struct class_interface *cl_intf)
sg_put_dev(sdp);
}
+static struct class_interface sg_interface = {
+ .add_dev = sg_add,
+ .remove_dev = sg_remove,
+};
+
module_param_named(scatter_elem_sz, scatter_elem_sz, int, S_IRUGO | S_IWUSR);
module_param_named(def_reserved_size, def_reserved_size, int,
S_IRUGO | S_IWUSR);
--
1.6.0.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] sg: kill unused SZ_SG_IOVEC define
2009-03-11 1:02 [PATCH 1/3] sg: kill unused SZ_SG_IOVEC define FUJITA Tomonori
2009-03-11 1:02 ` [PATCH 2/3] sg: remove unnecessary type casts FUJITA Tomonori
2009-03-11 1:02 ` [PATCH 3/3] sg: remove unnecessary forward declaration FUJITA Tomonori
@ 2009-04-01 14:03 ` FUJITA Tomonori
2009-04-01 16:40 ` Douglas Gilbert
3 siblings, 0 replies; 5+ messages in thread
From: FUJITA Tomonori @ 2009-04-01 14:03 UTC (permalink / raw)
To: dgilbert; +Cc: James.Bottomley, linux-scsi
On Wed, 11 Mar 2009 10:02:45 +0900
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
> drivers/scsi/sg.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index 17d1bd5..e84536b 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -204,7 +204,6 @@ static void sg_put_dev(Sg_device *sdp);
>
> #define SZ_SG_HEADER sizeof(struct sg_header)
> #define SZ_SG_IO_HDR sizeof(sg_io_hdr_t)
> -#define SZ_SG_IOVEC sizeof(sg_iovec_t)
> #define SZ_SG_REQ_INFO sizeof(sg_req_info_t)
>
> static int sg_allow_access(struct file *filp, unsigned char *cmd)
> --
> 1.6.0.6
Doug, can I get your ACKs on these patches? They just remove unused
code.
Thanks,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] sg: kill unused SZ_SG_IOVEC define
2009-03-11 1:02 [PATCH 1/3] sg: kill unused SZ_SG_IOVEC define FUJITA Tomonori
` (2 preceding siblings ...)
2009-04-01 14:03 ` [PATCH 1/3] sg: kill unused SZ_SG_IOVEC define FUJITA Tomonori
@ 2009-04-01 16:40 ` Douglas Gilbert
3 siblings, 0 replies; 5+ messages in thread
From: Douglas Gilbert @ 2009-04-01 16:40 UTC (permalink / raw)
To: FUJITA Tomonori; +Cc: James.Bottomley, linux-scsi
FUJITA Tomonori wrote:
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
> drivers/scsi/sg.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index 17d1bd5..e84536b 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -204,7 +204,6 @@ static void sg_put_dev(Sg_device *sdp);
>
> #define SZ_SG_HEADER sizeof(struct sg_header)
> #define SZ_SG_IO_HDR sizeof(sg_io_hdr_t)
> -#define SZ_SG_IOVEC sizeof(sg_iovec_t)
> #define SZ_SG_REQ_INFO sizeof(sg_req_info_t)
>
> static int sg_allow_access(struct file *filp, unsigned char *cmd)
For this patch:
[PATCH 1/3] sg: kill unused SZ_SG_IOVEC define
plus:
[PATCH 2/3] sg: remove unnecessary type casts
[PATCH 3/3] sg: remove unnecessary forward declaration
originally submitted 20090310
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-04-01 16:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-11 1:02 [PATCH 1/3] sg: kill unused SZ_SG_IOVEC define FUJITA Tomonori
2009-03-11 1:02 ` [PATCH 2/3] sg: remove unnecessary type casts FUJITA Tomonori
2009-03-11 1:02 ` [PATCH 3/3] sg: remove unnecessary forward declaration FUJITA Tomonori
2009-04-01 14:03 ` [PATCH 1/3] sg: kill unused SZ_SG_IOVEC define FUJITA Tomonori
2009-04-01 16:40 ` Douglas Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox