Removes some functions that are not used anywhere:
ahc_outq() ahc_inq()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/aic7xxx/aic7xxx_core.c | 26
Remove the function aic7770_find_device() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/aic7xxx/aic7770.c | 14 --
drivers
Removes some functions that are not used anywhere:
csk_print_ip() csk_print_port()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/cxgbi/libcxgbi.c | 28
2014-08-01 0:19 GMT+02:00 adam radford aradf...@gmail.com:
On Sun, Jul 27, 2014 at 8:11 AM, Rickard Strandqvist
rickard_strandqv...@spectrumdigital.se wrote:
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And use the sizeof on the to string rather than strlen
Remove the function cumanascsi_setup() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/arm/cumana_1.c |4
1 file changed, 4 deletions
2014-12-20 17:50 GMT+01:00 Jeremiah Mahler jmmah...@gmail.com:
On Sat, Dec 20, 2014 at 05:36:15PM +0100, Rickard Strandqvist wrote:
Remove the function cumanascsi_setup() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off
Remove the function gdth_ioctl_check_bin() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/gdth_proc.c | 18 --
1 file
Remove the function bfa_tskim_iodone() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bfa/bfa_fcpim.c |9 -
drivers/scsi/bfa
() fc_rrq_rsp_parse()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bfa/bfa_fcbuild.c | 607
drivers/scsi/bfa/bfa_fcbuild.h | 87
Remove the function bfad_drv_uninit() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bfa/bfad.c | 20
drivers/scsi
2014-10-20 17:37 GMT+02:00 Dan Carpenter dan.carpen...@oracle.com:
On Sun, Oct 19, 2014 at 12:13:10AM +0200, Rickard Strandqvist wrote:
Ensures that the string is null-terminate in connection with the
use of strncpy, by switching from strncpy to strzcpy.
I wish the changelogs were more clear
Ensures that the string is null-terminate in connection with the
use of strncpy, by switching from strncpy to strzcpy.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bfa/bfa_fcs_lport.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
2014-10-12 20:18 GMT+02:00 Joe Perches j...@perches.com:
On Sun, 2014-10-12 at 19:55 +0200, Rickard Strandqvist wrote:
Changed same snprintf and sprintf to strlcpy and strlcat.
This will guarantee that the string size is not overwritten,
and they are significantly faster than sprintf also.
I
2014-09-15 0:38 GMT+02:00 Elliott, Robert (Server Storage) elli...@hp.com:
-Original Message-
From: Rickard Strandqvist [mailto:rickard_strandqv...@spectrumdigital.se]
How do you mean?
strncpy zeroes throughout the remainder of the string from until the
length off to_length
I have revamped the code so it becomes both more effective and far more clear.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/scsi_devinfo.c | 31 +++
1 file changed, 11 insertions(+), 20 deletions(-)
diff --git a/drivers
2014-09-14 23:34 GMT+02:00 Elliott, Robert (Server Storage) elli...@hp.com:
-Original Message-
From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi-
ow...@vger.kernel.org] On Behalf Of Rickard Strandqvist
...
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi
Added a guaranteed null-terminate after call to strncpy.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/message/fusion/mptbase.c |4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/ibmvscsi/ibmvstgt.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b
If you are going to use memset before strncpy you must copy sizeof -1.
And removed unnecessary magic numbers.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/ch.c | 12
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers
If you use kzalloc before strncpy you must copy sizeof -1.
And removed unnecessary magic numbers.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/csiostor/csio_init.c |3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi
Code clarification using strlcpy instead of strncpy.
And removed unnecessary memset
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/hpsa.c | 16 +++-
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/scsi/hpsa.c b
And as I understand it, it is fine to replace strncpy to strlcpy here.
But if any of this code do not want a null terminated, or want to have the
whole rest of size filled with null characters.
If that is the case this is not a good patch.
Rickard Strandqvist (1):
scsi: ibmvscsi: ibmvfc.c
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/ibmvscsi/ibmvfc.c | 10 ++
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c
2014-07-28 16:31 GMT+02:00 Jeff Moyer jmo...@redhat.com:
Rickard Strandqvist rickard_strandqv...@spectrumdigital.se writes:
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
block/bsg.c
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And in some cases modified to copy one character less than the overall
length, as the entire area is already zeroed.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/qla4xxx
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And use the sizeof on the to string rather than strlen on the from string.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/3w-9xxx.c |3 ++-
1 file changed, 2 insertions
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And use the sizeof on the to string rather than strlen on the from string.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bfa/bfa_fcbuild.c |8
1 file changed, 4
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
In some cases modified to copy one character less than the overall
length, as the entire area is already zeroed. And replacing strncat
with strlcat because of incorrect use.
Signed-off-by: Rickard Strandqvist
Replacing strncp with strlcpy to avoid strings that lacks null terminate.
And strncat with strlcat because of incorrect use,
removed same the duplicated code.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bfa/bfa_fcs.c | 80
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bfa/bfad_attr.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/ibmvscsi/ibmvscsi.c |7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/qla4xxx/ql4_os.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/qla4xxx
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bfa/bfad_bsg.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And removed unnecessary magic numbers.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/mpt2sas/mpt2sas_base.c | 31 +++
1 file changed, 15
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And removed unnecessary magic numbers.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/mpt3sas/mpt3sas_base.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
If you are going to use memset before strncpy you must copy sizeof -1
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/scsi_tgt_if.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_tgt_if.c b/drivers/scsi
I guess it's not meant to me.
And it looks however now that I've done quite a few more patches that
there should not have been any {}
And then, it is perhaps good to sett a start value for ioc_status. My
suggestion is:
u16 ioc_status = MPI2_IOCSTATUS_OP_STATE_NOT_SUPPORTED;
Kind regards
Rickard
A struct member variable is set to different values without having used in
between.
This was found using a static code analysis program called cppcheck
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bnx2i/bnx2i_iscsi.c |3 +--
1 file changed, 1
After some discussion, all agreed that the previous value was incorrect.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bnx2i/bnx2i_iscsi.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b
A struct member variable is set to the same value more than once
This was found using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/advansys.c |2 --
1 file changed, 2 deletions(-)
diff --git
A struct member variable is set to different values without having used in
between.
This was found using a static code analysis program called cppcheck
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/pm8001/pm80xx_hwi.c |1 -
1 file changed, 1
A struct member variable is set to different values without having used in
between.
This was found using a static code analysis program called cppcheck
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bnx2i/bnx2i_iscsi.c |1 -
1 file changed, 1
2014-06-25 19:13 GMT+02:00 Eddie Wai eddie@broadcom.com:
On Wed, 2014-06-25 at 16:26 +0200, Maurizio Lombardi wrote:
Hi,
On 06/25/2014 04:04 PM, Rickard Strandqvist wrote:
A struct member variable is set to different values without having used in
between.
This was found using
A variable to manage the error code is not returned.
This was partly found using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/mpt3sas/mpt3sas_base.c |2 +-
1 file changed, 1 insertion(+), 1
the whole
incoming struct.
But the only thing that is done then is a:
strncpy(port_attr-port_sym_name.symname,
(char *)bfa_fcs_lport_get_psym_name(port), BFA_SYMNAME_MAXLEN);
Thus not having BFA_SYMNAME_MAXLEN -1 that would be a solution.
Best regards
Rickard Strandqvist
2014-06-04
to switch to strcpy outright.
So what happens now?
Should I make a new patch, with strlcpy or just straight off with strcpy then?
Best regards
Rickard Strandqvist
2014-06-05 0:28 GMT+02:00 James Bottomley
james.bottom...@hansenpartnership.com:
On Wed, 2014-06-04 at 23:36 +0200, Rickard Strandqvist
Minimized the use of snprintf()
And removed a variable that was only used for the temporary storage.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bfa/bfad_attr.c | 114 --
1 file changed, 66 insertions(+), 48
of snprintf to strlcpy.
Best regards
Rickard Strandqvist
2014-06-05 9:10 GMT+02:00 Bart Van Assche bvanass...@acm.org:
On 06/05/14 08:55, Bart Van Assche wrote:
On 06/04/14 20:08, Rickard Strandqvist wrote:
This is ugly. Please use sprintf(buf, %.*s\n, PAGE_SIZE - 1, str)
instead of strncpy
Minimized the use of snprintf()
And removed a variable that was only used for the temporary storage.
This was partly found using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bfa/bfad_attr.c | 14
Added a guaranteed null-terminate after call to strncpy.
This was partly found using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bfa/bfad_attr.c |3 ++-
1 file changed, 2 insertions(+), 1 deletion
Hi
A little embarrassing, but I actually did not know that there was a
better replacement for strncpy.
Sorry, but I will send a new platch based on strlcpy instead then.
Will investigate cover letter then to.
Best regards
Rickard Strandqvist
2014-06-05 0:01 GMT+02:00 Joe Perches j
Hi
Quite rightly, this is what cppcheck reacts.
Ok, I'll send a patch for that instead then.
Best regards
Rickard Strandqvist
2014-05-28 13:38 GMT+02:00 Tomas Henzl the...@redhat.com:
On 05/28/2014 01:28 PM, Christoph Hellwig wrote:
On Sun, May 18, 2014 at 06:14:00PM +0200, Rickard
Removal of null pointer checks that could never happen
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/pm8001/pm8001_hwi.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001
Okay, good!
Or, do I need to do anything else :-)
Best regards
Rickard Strandqvist
2014-05-19 13:39 GMT+02:00 Oliver Neukum oneu...@suse.de:
On Sun, 2014-05-18 at 21:50 +0200, Guennadi Liakhovetski wrote:
On Sun, 18 May 2014, Rickard Strandqvist wrote:
There is otherwise a risk
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/message/fusion/mptscsih.c |4 +++-
1 file changed, 3 insertions
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bfa/bfa_fcs_lport.c |3 ++-
1 file changed, 2 insertions
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bnx2i/bnx2i_iscsi.c |5 -
1 file changed, 4 insertions
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/dc395x.c |2 +-
1 file changed, 1 insertion(+), 1 deletion
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/mpt2sas/mpt2sas_base.c |4 +++-
1 file changed, 3
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/mvsas/mv_sas.c | 24 ++--
1 file changed
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/pm8001/pm8001_hwi.c |3 ++-
1 file changed, 2 insertions
61 matches
Mail list logo