All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: gasket: Create a new variable to improve readability
@ 2019-03-16 19:54 anushkacharu9
  2019-03-17 10:13 ` [Outreachy kernel] " Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: anushkacharu9 @ 2019-03-16 19:54 UTC (permalink / raw)
  To: gregkh, outreachy-kernel; +Cc: Anushka Shukla

From: Anushka Shukla <anushkacharu9@gmail.com>

- Define a new variable temp_table.
- Modify it to maintain Linux Kernel Coding style.

Signed-off-by: Anushka Shukla <anushkacharu9@gmail.com>
---
 drivers/staging/gasket/apex_driver.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/gasket/apex_driver.c b/drivers/staging/gasket/apex_driver.c
index 7c2ffa467557..d0fffb51c9c4 100644
--- a/drivers/staging/gasket/apex_driver.c
+++ b/drivers/staging/gasket/apex_driver.c
@@ -526,21 +526,22 @@ static ssize_t sysfs_show(struct device *device, struct device_attribute *attr,
 	}
 
 	type = (enum sysfs_attribute_type)gasket_attr->data.attr_type;
+	struct gasket_page_table *temp_table = gasket_dev->page_table[0]
 	switch (type) {
 	case ATTR_KERNEL_HIB_PAGE_TABLE_SIZE:
 		ret = scnprintf(buf, PAGE_SIZE, "%u\n",
-				gasket_page_table_num_entries
-				       (gasket_dev->page_table[0]));
+				gasket_page_table_num_entries(temp_table);
+				       
 		break;
 	case ATTR_KERNEL_HIB_SIMPLE_PAGE_TABLE_SIZE:
 		ret = scnprintf(buf, PAGE_SIZE, "%u\n",
-				gasket_page_table_num_entries
-				       (gasket_dev->page_table[0]));
+				gasket_page_table_num_entries(temp_table);
+				       
 		break;
 	case ATTR_KERNEL_HIB_NUM_ACTIVE_PAGES:
 		ret = scnprintf(buf, PAGE_SIZE, "%u\n",
-				gasket_page_table_num_active_pages
-				       (gasket_dev->page_table[0]));
+				gasket_page_table_num_active_pages(temp_table);
+				       
 		break;
 	default:
 		dev_dbg(gasket_dev->dev, "Unknown attribute: %s\n",
-- 
2.17.1



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

end of thread, other threads:[~2019-03-17 10:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-16 19:54 [PATCH] Staging: gasket: Create a new variable to improve readability anushkacharu9
2019-03-17 10:13 ` [Outreachy kernel] " Greg KH

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.