Skip to contentSkip to conversation

staging: dgnc: Add const qualifier to struct declaration.

PATCH In review Elise Lennion 2 participants 2 messages Oct 15, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: dgnc: Add const qualifier to struct declaration.

Const qualifier added to struct declaration to avoid data overwrite during runtime and improve security.

---

v2: Rewrite log message.

 drivers/staging/dgnc/dgnc_driver.c | 2 +-
 drivers/staging/dgnc/dgnc_tty.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +1 -1
index fd372d3..6576674 100644
@@ -93,7 +93,7 @@ struct board_id {
 	unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_ids[] = {
+static const struct board_id dgnc_ids[] = {
 	{	PCI_DEVICE_CLASSIC_4_PCI_NAME,		4,	0	},
 	{	PCI_DEVICE_CLASSIC_4_422_PCI_NAME,	4,	0	},
 	{	PCI_DEVICE_CLASSIC_8_PCI_NAME,		8,	0	},
drivers/staging/dgnc/dgnc_tty.c +1 -1
index ef9a45b..cf8aefd 100644
@@ -50,7 +50,7 @@ static unsigned char		*dgnc_TmpWriteBuf;
 /*
  * Default transparent print information.
  */
-static struct digi_t dgnc_digi_init = {
+static const struct digi_t dgnc_digi_init = {
 	.digi_flags =	DIGI_COOK,	/* Flags			*/
 	.digi_maxcps =	100,		/* Max CPS			*/
 	.digi_maxchar =	50,		/* Max chars in print queue	*/
Signature · 1 line
2.7.4
Acked-by on v2 1/1
#1 lore raw
Quoted 4 lines · Elise Lennion

Const qualifier added to struct declaration to avoid data overwrite during runtime and improve security.

Quoted 44 lines

---

v2: Rewrite log message.

 drivers/staging/dgnc/dgnc_driver.c | 2 +-
 drivers/staging/dgnc/dgnc_tty.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +1 -1
index fd372d3..6576674 100644
@@ -93,7 +93,7 @@ struct board_id {
 	unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_ids[] = {
+static const struct board_id dgnc_ids[] = {
 	{	PCI_DEVICE_CLASSIC_4_PCI_NAME,		4,	0	},
 	{	PCI_DEVICE_CLASSIC_4_422_PCI_NAME,	4,	0	},
 	{	PCI_DEVICE_CLASSIC_8_PCI_NAME,		8,	0	},
drivers/staging/dgnc/dgnc_tty.c +1 -2
index ef9a45b..cf8aefd 100644
@@ -50,7 +50,7 @@ static unsigned char		*dgnc_TmpWriteBuf;
 /*
  * Default transparent print information.
  */
-static struct digi_t dgnc_digi_init = {
+static const struct digi_t dgnc_digi_init = {
 	.digi_flags =	DIGI_COOK,	/* Flags			*/
 	.digi_maxcps =	100,		/* Max CPS			*/
 	.digi_maxchar =	50,		/* Max chars in print queue	*/
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20161015003513.GA16186%40lennorien.com.
For more options, visit https://groups.google.com/d/optout.