linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] osd: remove deadcode
@ 2016-02-24 11:21 Sudip Mukherjee
  2016-02-24 13:41 ` Matthew R. Ochs
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sudip Mukherjee @ 2016-02-24 11:21 UTC (permalink / raw)
  To: Boaz Harrosh, Benny Halevy, Martin K. Petersen
  Cc: linux-kernel, osd-dev, linux-scsi, Sudip Mukherjee, Joe Perches

The variable is_ver1 is always true and so OSD_CAP_LEN can never be
used.
Reported by Coverity.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
---

v2: Joe Perches asked to mention the tool used in the commit log.

 drivers/scsi/osd/osd_initiator.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
index d8a2b51..3b11aad 100644
--- a/drivers/scsi/osd/osd_initiator.c
+++ b/drivers/scsi/osd/osd_initiator.c
@@ -2006,9 +2006,8 @@ EXPORT_SYMBOL(osd_sec_init_nosec_doall_caps);
  */
 void osd_set_caps(struct osd_cdb *cdb, const void *caps)
 {
-	bool is_ver1 = true;
 	/* NOTE: They start at same address */
-	memcpy(&cdb->v1.caps, caps, is_ver1 ? OSDv1_CAP_LEN : OSD_CAP_LEN);
+	memcpy(&cdb->v1.caps, caps, OSDv1_CAP_LEN);
 }
 
 bool osd_is_sec_alldata(struct osd_security_parameters *sec_parms __unused)
-- 
1.9.1

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

* Re: [PATCH v2] osd: remove deadcode
  2016-02-24 11:21 [PATCH v2] osd: remove deadcode Sudip Mukherjee
@ 2016-02-24 13:41 ` Matthew R. Ochs
  2016-02-24 14:58 ` Boaz Harrosh
  2016-02-26  2:12 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Matthew R. Ochs @ 2016-02-24 13:41 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Boaz Harrosh, Benny Halevy, Martin K. Petersen, linux-kernel,
	osd-dev, linux-scsi, Joe Perches

Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>

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

* Re: [PATCH v2] osd: remove deadcode
  2016-02-24 11:21 [PATCH v2] osd: remove deadcode Sudip Mukherjee
  2016-02-24 13:41 ` Matthew R. Ochs
@ 2016-02-24 14:58 ` Boaz Harrosh
  2016-02-26  2:12 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Boaz Harrosh @ 2016-02-24 14:58 UTC (permalink / raw)
  To: Sudip Mukherjee, Benny Halevy, Martin K. Petersen,
	James Bottomley
  Cc: linux-kernel, osd-dev, linux-scsi, Joe Perches

On 02/24/2016 01:21 PM, Sudip Mukherjee wrote:
> The variable is_ver1 is always true and so OSD_CAP_LEN can never be
> used.
> Reported by Coverity.
> 
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>

ACK-by: Boaz harrosh <ooo@elecrozaur.com>

Thanks
> ---
> 
> v2: Joe Perches asked to mention the tool used in the commit log.
> 
>  drivers/scsi/osd/osd_initiator.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
> index d8a2b51..3b11aad 100644
> --- a/drivers/scsi/osd/osd_initiator.c
> +++ b/drivers/scsi/osd/osd_initiator.c
> @@ -2006,9 +2006,8 @@ EXPORT_SYMBOL(osd_sec_init_nosec_doall_caps);
>   */
>  void osd_set_caps(struct osd_cdb *cdb, const void *caps)
>  {
> -	bool is_ver1 = true;
>  	/* NOTE: They start at same address */
> -	memcpy(&cdb->v1.caps, caps, is_ver1 ? OSDv1_CAP_LEN : OSD_CAP_LEN);
> +	memcpy(&cdb->v1.caps, caps, OSDv1_CAP_LEN);
>  }
>  
>  bool osd_is_sec_alldata(struct osd_security_parameters *sec_parms __unused)
> 

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

* Re: [PATCH v2] osd: remove deadcode
  2016-02-24 11:21 [PATCH v2] osd: remove deadcode Sudip Mukherjee
  2016-02-24 13:41 ` Matthew R. Ochs
  2016-02-24 14:58 ` Boaz Harrosh
@ 2016-02-26  2:12 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2016-02-26  2:12 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Boaz Harrosh, Benny Halevy, Martin K. Petersen, linux-kernel,
	osd-dev, linux-scsi, Joe Perches

>>>>> "Sudip" == Sudip Mukherjee <sudipm.mukherjee@gmail.com> writes:

Sudip> The variable is_ver1 is always true and so OSD_CAP_LEN can never
Sudip> be used.  Reported by Coverity.

Applied to 4.6/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2016-02-26  2:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-24 11:21 [PATCH v2] osd: remove deadcode Sudip Mukherjee
2016-02-24 13:41 ` Matthew R. Ochs
2016-02-24 14:58 ` Boaz Harrosh
2016-02-26  2:12 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).