All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] SCSI-sg: Adjustments for two function implementations
@ 2017-08-25 20:22 ` SF Markus Elfring
  0 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-08-25 20:22 UTC (permalink / raw)
  To: linux-scsi, Doug Gilbert, James E. J. Bottomley, Martin K. Petersen
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 25 Aug 2017 22:20:02 +0200

A few update suggestions were taken into account
from static source code analysis.

Markus Elfring (3):
  Delete an error message for a failed memory allocation in sg_alloc()
  Improve a size determination in sg_alloc()
  Fix a typo in a comment line in sg_ioctl()

 drivers/scsi/sg.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

-- 
2.14.0

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

* [PATCH 0/3] SCSI-sg: Adjustments for two function implementations
@ 2017-08-25 20:22 ` SF Markus Elfring
  0 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-08-25 20:22 UTC (permalink / raw)
  To: linux-scsi, Doug Gilbert, James E. J. Bottomley, Martin K. Petersen
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 25 Aug 2017 22:20:02 +0200

A few update suggestions were taken into account
from static source code analysis.

Markus Elfring (3):
  Delete an error message for a failed memory allocation in sg_alloc()
  Improve a size determination in sg_alloc()
  Fix a typo in a comment line in sg_ioctl()

 drivers/scsi/sg.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

-- 
2.14.0


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

* [PATCH 1/3] SCSI-sg: Delete an error message for a failed memory allocation in sg_alloc()
  2017-08-25 20:22 ` SF Markus Elfring
@ 2017-08-25 20:23   ` SF Markus Elfring
  -1 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-08-25 20:23 UTC (permalink / raw)
  To: linux-scsi, Doug Gilbert, James E. J. Bottomley, Martin K. Petersen
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 25 Aug 2017 21:48:11 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/scsi/sg.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index d7ff71e0c85c..8ca10a2fc1a0 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1404,11 +1404,8 @@ sg_alloc(struct gendisk *disk, struct scsi_device *scsidp)
 	u32 k;
 
 	sdp = kzalloc(sizeof(Sg_device), GFP_KERNEL);
-	if (!sdp) {
-		sdev_printk(KERN_WARNING, scsidp, "%s: kmalloc Sg_device "
-			    "failure\n", __func__);
+	if (!sdp)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	idr_preload(GFP_KERNEL);
 	write_lock_irqsave(&sg_index_lock, iflags);
-- 
2.14.0

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

* [PATCH 1/3] SCSI-sg: Delete an error message for a failed memory allocation in sg_alloc()
@ 2017-08-25 20:23   ` SF Markus Elfring
  0 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-08-25 20:23 UTC (permalink / raw)
  To: linux-scsi, Doug Gilbert, James E. J. Bottomley, Martin K. Petersen
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 25 Aug 2017 21:48:11 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/scsi/sg.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index d7ff71e0c85c..8ca10a2fc1a0 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1404,11 +1404,8 @@ sg_alloc(struct gendisk *disk, struct scsi_device *scsidp)
 	u32 k;
 
 	sdp = kzalloc(sizeof(Sg_device), GFP_KERNEL);
-	if (!sdp) {
-		sdev_printk(KERN_WARNING, scsidp, "%s: kmalloc Sg_device "
-			    "failure\n", __func__);
+	if (!sdp)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	idr_preload(GFP_KERNEL);
 	write_lock_irqsave(&sg_index_lock, iflags);
-- 
2.14.0


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

* [PATCH 2/3] SCSI-sg: Improve a size determination in sg_alloc()
  2017-08-25 20:22 ` SF Markus Elfring
@ 2017-08-25 20:25   ` SF Markus Elfring
  -1 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-08-25 20:25 UTC (permalink / raw)
  To: linux-scsi, Doug Gilbert, James E. J. Bottomley, Martin K. Petersen
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 25 Aug 2017 21:55:14 +0200

Replace the specification of a data type by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/scsi/sg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 8ca10a2fc1a0..4a2db7ff14cc 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1403,7 +1403,7 @@ sg_alloc(struct gendisk *disk, struct scsi_device *scsidp)
 	int error;
 	u32 k;
 
-	sdp = kzalloc(sizeof(Sg_device), GFP_KERNEL);
+	sdp = kzalloc(sizeof(*sdp), GFP_KERNEL);
 	if (!sdp)
 		return ERR_PTR(-ENOMEM);
 
-- 
2.14.0

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

* [PATCH 2/3] SCSI-sg: Improve a size determination in sg_alloc()
@ 2017-08-25 20:25   ` SF Markus Elfring
  0 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-08-25 20:25 UTC (permalink / raw)
  To: linux-scsi, Doug Gilbert, James E. J. Bottomley, Martin K. Petersen
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 25 Aug 2017 21:55:14 +0200

Replace the specification of a data type by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/scsi/sg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 8ca10a2fc1a0..4a2db7ff14cc 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1403,7 +1403,7 @@ sg_alloc(struct gendisk *disk, struct scsi_device *scsidp)
 	int error;
 	u32 k;
 
-	sdp = kzalloc(sizeof(Sg_device), GFP_KERNEL);
+	sdp = kzalloc(sizeof(*sdp), GFP_KERNEL);
 	if (!sdp)
 		return ERR_PTR(-ENOMEM);
 
-- 
2.14.0


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

* [PATCH 3/3] SCSI-sg: Fix a typo in a comment line in sg_ioctl()
  2017-08-25 20:22 ` SF Markus Elfring
@ 2017-08-25 20:26   ` SF Markus Elfring
  -1 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-08-25 20:26 UTC (permalink / raw)
  To: linux-scsi, Doug Gilbert, James E. J. Bottomley, Martin K. Petersen
  Cc: LKML, kernel-janitors, trivial

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 25 Aug 2017 22:06:59 +0200

Fix a word in this description.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/scsi/sg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 4a2db7ff14cc..c80899d249c6 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -891,7 +891,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
 	case SG_SET_FORCE_LOW_DMA:
 		/*
 		 * N.B. This ioctl never worked properly, but failed to
-		 * return an error value. So returning '0' to keep compability
+		 * return an error value. So returning '0' to keep compatibility
 		 * with legacy applications.
 		 */
 		return 0;
-- 
2.14.0

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

* [PATCH 3/3] SCSI-sg: Fix a typo in a comment line in sg_ioctl()
@ 2017-08-25 20:26   ` SF Markus Elfring
  0 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-08-25 20:26 UTC (permalink / raw)
  To: linux-scsi, Doug Gilbert, James E. J. Bottomley, Martin K. Petersen
  Cc: LKML, kernel-janitors, trivial

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 25 Aug 2017 22:06:59 +0200

Fix a word in this description.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/scsi/sg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 4a2db7ff14cc..c80899d249c6 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -891,7 +891,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
 	case SG_SET_FORCE_LOW_DMA:
 		/*
 		 * N.B. This ioctl never worked properly, but failed to
-		 * return an error value. So returning '0' to keep compability
+		 * return an error value. So returning '0' to keep compatibility
 		 * with legacy applications.
 		 */
 		return 0;
-- 
2.14.0


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

end of thread, other threads:[~2017-08-25 20:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-25 20:22 [PATCH 0/3] SCSI-sg: Adjustments for two function implementations SF Markus Elfring
2017-08-25 20:22 ` SF Markus Elfring
2017-08-25 20:23 ` [PATCH 1/3] SCSI-sg: Delete an error message for a failed memory allocation in sg_alloc() SF Markus Elfring
2017-08-25 20:23   ` SF Markus Elfring
2017-08-25 20:25 ` [PATCH 2/3] SCSI-sg: Improve a size determination " SF Markus Elfring
2017-08-25 20:25   ` SF Markus Elfring
2017-08-25 20:26 ` [PATCH 3/3] SCSI-sg: Fix a typo in a comment line in sg_ioctl() SF Markus Elfring
2017-08-25 20:26   ` SF Markus Elfring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.