diff mbox series

[20/24] scsi: remove a very misleading comment

Message ID 20210712054816.4147559-21-hch@lst.de
State Superseded
Headers show
Series [01/24] bsg: remove support for SCSI_IOCTL_SEND_COMMAND | expand

Commit Message

Christoph Hellwig July 12, 2021, 5:48 a.m. UTC
Remove the comment above ioctl_internal_command, which doesn't
document this function at all.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/scsi/scsi_ioctl.c | 23 -----------------------
 1 file changed, 23 deletions(-)

Comments

Bart Van Assche July 22, 2021, 5:52 p.m. UTC | #1
On 7/11/21 10:48 PM, Christoph Hellwig wrote:
> Remove the comment above ioctl_internal_command, which doesn't

> document this function at all.

> 

> Signed-off-by: Christoph Hellwig <hch@lst.de>

> ---

>   drivers/scsi/scsi_ioctl.c | 23 -----------------------

>   1 file changed, 23 deletions(-)

> 

> diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c

> index a70ddc1eb313..3d4311a78383 100644

> --- a/drivers/scsi/scsi_ioctl.c

> +++ b/drivers/scsi/scsi_ioctl.c

> @@ -64,29 +64,6 @@ static int ioctl_probe(struct Scsi_Host *host, void __user *buffer)

>   	return 1;

>   }

>   

> -/*

> -

> - * The SCSI_IOCTL_SEND_COMMAND ioctl sends a command out to the SCSI host.

> - * The IOCTL_NORMAL_TIMEOUT and NORMAL_RETRIES  variables are used.

> - *

> - * dev is the SCSI device struct ptr, *(int *) arg is the length of the

> - * input data, if any, not including the command string & counts,

> - * *((int *)arg + 1) is the output buffer size in bytes.

> - *

> - * *(char *) ((int *) arg)[2] the actual command byte.

> - *

> - * Note that if more than MAX_BUF bytes are requested to be transferred,

> - * the ioctl will fail with error EINVAL.

> - *

> - * This size *does not* include the initial lengths that were passed.

> - *

> - * The SCSI command is read from the memory location immediately after the

> - * length words, and the input data is right after the command.  The SCSI

> - * routines know the command size based on the opcode decode.

> - *

> - * The output area is then filled in starting from the command byte.

> - */

> -

>   static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,

>   				  int timeout, int retries)

>   {


How about adding a comment that explains what this function does? How 
about declaring 'cmd' const and adding a comment that it is a pointer to 
a SCSI CDB? How about documenting the unit of 'timeout'?

Thanks,

Bart.
Christoph Hellwig July 22, 2021, 7:21 p.m. UTC | #2
On Thu, Jul 22, 2021 at 10:52:44AM -0700, Bart Van Assche wrote:
>> - * routines know the command size based on the opcode decode.

>> - *

>> - * The output area is then filled in starting from the command byte.

>> - */

>> -

>>   static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,

>>   				  int timeout, int retries)

>>   {

>

> How about adding a comment that explains what this function does? How about 

> declaring 'cmd' const and adding a comment that it is a pointer to a SCSI 

> CDB? How about documenting the unit of 'timeout'?


Not sure there is much of a point for a static function in (pun intended)
fairly static code.
diff mbox series

Patch

diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index a70ddc1eb313..3d4311a78383 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -64,29 +64,6 @@  static int ioctl_probe(struct Scsi_Host *host, void __user *buffer)
 	return 1;
 }
 
-/*
-
- * The SCSI_IOCTL_SEND_COMMAND ioctl sends a command out to the SCSI host.
- * The IOCTL_NORMAL_TIMEOUT and NORMAL_RETRIES  variables are used.  
- * 
- * dev is the SCSI device struct ptr, *(int *) arg is the length of the
- * input data, if any, not including the command string & counts, 
- * *((int *)arg + 1) is the output buffer size in bytes.
- * 
- * *(char *) ((int *) arg)[2] the actual command byte.   
- * 
- * Note that if more than MAX_BUF bytes are requested to be transferred,
- * the ioctl will fail with error EINVAL.
- * 
- * This size *does not* include the initial lengths that were passed.
- * 
- * The SCSI command is read from the memory location immediately after the
- * length words, and the input data is right after the command.  The SCSI
- * routines know the command size based on the opcode decode.  
- * 
- * The output area is then filled in starting from the command byte. 
- */
-
 static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,
 				  int timeout, int retries)
 {