diff options
author | Andy Grover <agrover@redhat.com> | 2013-05-16 13:41:00 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-06-14 03:04:50 -0400 |
commit | 4dee96fb366ec6b5b324c8d4fe9e04244cb32f5d (patch) | |
tree | be0361f660d94102ee403c4ce45dc5002d533bf3 /drivers/target/target_core_pr.c | |
parent | 4e529be27d0ec4b9c6e4fd1b2908fa21b28539b1 (diff) |
target: Remove unneeded param pr_aptpl_buf_len to write_aptpl_to_file()
As mentioned in the comments in update_and_write_aptpl,
write_aptpl_to_file() calls strlen() on the buffer, and the length was
always being passed as zero.
Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_pr.c')
-rw-r--r-- | drivers/target/target_core_pr.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 157368429a51..26c1f2d8920f 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c | |||
@@ -1932,13 +1932,13 @@ out: | |||
1932 | */ | 1932 | */ |
1933 | static int __core_scsi3_write_aptpl_to_file( | 1933 | static int __core_scsi3_write_aptpl_to_file( |
1934 | struct se_device *dev, | 1934 | struct se_device *dev, |
1935 | unsigned char *buf, | 1935 | unsigned char *buf) |
1936 | u32 pr_aptpl_buf_len) | ||
1937 | { | 1936 | { |
1938 | struct t10_wwn *wwn = &dev->t10_wwn; | 1937 | struct t10_wwn *wwn = &dev->t10_wwn; |
1939 | struct file *file; | 1938 | struct file *file; |
1940 | int flags = O_RDWR | O_CREAT | O_TRUNC; | 1939 | int flags = O_RDWR | O_CREAT | O_TRUNC; |
1941 | char path[512]; | 1940 | char path[512]; |
1941 | u32 pr_aptpl_buf_len; | ||
1942 | int ret; | 1942 | int ret; |
1943 | 1943 | ||
1944 | memset(path, 0, 512); | 1944 | memset(path, 0, 512); |
@@ -1957,8 +1957,7 @@ static int __core_scsi3_write_aptpl_to_file( | |||
1957 | return PTR_ERR(file); | 1957 | return PTR_ERR(file); |
1958 | } | 1958 | } |
1959 | 1959 | ||
1960 | if (!pr_aptpl_buf_len) | 1960 | pr_aptpl_buf_len = (strlen(buf) + 1); /* Add extra for NULL */ |
1961 | pr_aptpl_buf_len = (strlen(&buf[0]) + 1); /* Add extra for NULL */ | ||
1962 | 1961 | ||
1963 | ret = kernel_write(file, buf, pr_aptpl_buf_len, 0); | 1962 | ret = kernel_write(file, buf, pr_aptpl_buf_len, 0); |
1964 | 1963 | ||
@@ -1993,7 +1992,7 @@ core_scsi3_update_and_write_aptpl(struct se_device *dev, unsigned char *in_buf, | |||
1993 | * __core_scsi3_write_aptpl_to_file() will call strlen() | 1992 | * __core_scsi3_write_aptpl_to_file() will call strlen() |
1994 | * on the passed buf to determine pr_aptpl_buf_len. | 1993 | * on the passed buf to determine pr_aptpl_buf_len. |
1995 | */ | 1994 | */ |
1996 | return __core_scsi3_write_aptpl_to_file(dev, buf, 0); | 1995 | return __core_scsi3_write_aptpl_to_file(dev, buf); |
1997 | } | 1996 | } |
1998 | 1997 | ||
1999 | static sense_reason_t | 1998 | static sense_reason_t |