* [PATCH 0/2] Code Styte
@ 2015-02-02 18:26 Ricardo Ribalda Delgado
2015-02-02 18:26 ` [PATCH 1/2] staging/unisys/visorutil/procobjecttree: Code Style Ricardo Ribalda Delgado
2015-02-02 18:26 ` [PATCH 2/2] staging/unisys/visorutil/procobjecttree: Replace typedef Ricardo Ribalda Delgado
0 siblings, 2 replies; 4+ messages in thread
From: Ricardo Ribalda Delgado @ 2015-02-02 18:26 UTC (permalink / raw)
To: Masaru Nomura, Peter P Waskiewicz Jr, Tapasweni Pathak,
Iulia Manda, Catalina Mocanu, sparmaintainer, devel,
linux-kernel
Cc: Ricardo Ribalda Delgado
Fix minor code stype problems found by checkpatch.pl
Ricardo Ribalda Delgado (2):
staging/unisys/visorutil/procobjecttree: Code Style
staging/unisys/visorutil/procobjecttree: Replace typedef
drivers/staging/unisys/visorutil/procobjecttree.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
--
2.1.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] staging/unisys/visorutil/procobjecttree: Code Style
2015-02-02 18:26 [PATCH 0/2] Code Styte Ricardo Ribalda Delgado
@ 2015-02-02 18:26 ` Ricardo Ribalda Delgado
2015-02-02 18:26 ` [PATCH 2/2] staging/unisys/visorutil/procobjecttree: Replace typedef Ricardo Ribalda Delgado
1 sibling, 0 replies; 4+ messages in thread
From: Ricardo Ribalda Delgado @ 2015-02-02 18:26 UTC (permalink / raw)
To: Masaru Nomura, Peter P Waskiewicz Jr, Tapasweni Pathak,
Iulia Manda, Catalina Mocanu, sparmaintainer, devel,
linux-kernel
Cc: Ricardo Ribalda Delgado
Lines should not be over 80 characters
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
drivers/staging/unisys/visorutil/procobjecttree.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/unisys/visorutil/procobjecttree.c b/drivers/staging/unisys/visorutil/procobjecttree.c
index 195772d..637c5ef 100644
--- a/drivers/staging/unisys/visorutil/procobjecttree.c
+++ b/drivers/staging/unisys/visorutil/procobjecttree.c
@@ -260,9 +260,9 @@ MYPROCOBJECT *visor_proc_CreateObject(MYPROCTYPE *type,
ERRDRV("out of memory\n");
goto Away;
}
- obj->procDirProperties =
- kzalloc((type->nProperties + 1) * sizeof(struct proc_dir_entry *),
- GFP_KERNEL | __GFP_NORETRY);
+ obj->procDirProperties = kzalloc((type->nProperties + 1) *
+ sizeof(struct proc_dir_entry *),
+ GFP_KERNEL | __GFP_NORETRY);
if (obj->procDirProperties == NULL) {
ERRDRV("out of memory\n");
goto Away;
@@ -276,8 +276,8 @@ MYPROCOBJECT *visor_proc_CreateObject(MYPROCTYPE *type,
/* only create properties that have names */
obj->procDirProperties[i] =
createProcFile(type->propertyNames[i],
- obj->procDir, &proc_fops,
- &obj->procDirPropertyContexts[i]);
+ obj->procDir, &proc_fops,
+ &obj->procDirPropertyContexts[i]);
if (obj->procDirProperties[i] == NULL) {
rc = NULL;
goto Away;
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] staging/unisys/visorutil/procobjecttree: Replace typedef
2015-02-02 18:26 [PATCH 0/2] Code Styte Ricardo Ribalda Delgado
2015-02-02 18:26 ` [PATCH 1/2] staging/unisys/visorutil/procobjecttree: Code Style Ricardo Ribalda Delgado
@ 2015-02-02 18:26 ` Ricardo Ribalda Delgado
2015-02-02 18:32 ` Joe Perches
1 sibling, 1 reply; 4+ messages in thread
From: Ricardo Ribalda Delgado @ 2015-02-02 18:26 UTC (permalink / raw)
To: Masaru Nomura, Peter P Waskiewicz Jr, Tapasweni Pathak,
Iulia Manda, Catalina Mocanu, sparmaintainer, devel,
linux-kernel
Cc: Ricardo Ribalda Delgado
Instead of declaring a new type, define a new struct.
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
drivers/staging/unisys/visorutil/procobjecttree.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/unisys/visorutil/procobjecttree.c b/drivers/staging/unisys/visorutil/procobjecttree.c
index 637c5ef..fb5df92 100644
--- a/drivers/staging/unisys/visorutil/procobjecttree.c
+++ b/drivers/staging/unisys/visorutil/procobjecttree.c
@@ -25,12 +25,12 @@
* need in order to call the callback function that supplies the /proc read
* info for that file.
*/
-typedef struct {
+struct proc_dir_entry_context {
void (*show_property)(struct seq_file *, void *, int);
MYPROCOBJECT *procObject;
int propertyIndex;
-} PROCDIRENTRYCONTEXT;
+};
/** This describes the attributes of a tree rooted at
* <procDirRoot>/<name[0]>/<name[1]>/...
@@ -86,7 +86,7 @@ struct MYPROCOBJECT_Tag {
/** this is a holding area for the context information that is needed
* to run the /proc callback function */
- PROCDIRENTRYCONTEXT *procDirPropertyContexts;
+ struct proc_dir_entry_context *procDirPropertyContexts;
};
@@ -254,7 +254,8 @@ MYPROCOBJECT *visor_proc_CreateObject(MYPROCTYPE *type,
goto Away;
}
obj->procDirPropertyContexts =
- kzalloc((type->nProperties + 1) * sizeof(PROCDIRENTRYCONTEXT),
+ kzalloc((type->nProperties + 1) *
+ sizeof(struct proc_dir_entry_context),
GFP_KERNEL | __GFP_NORETRY);
if (obj->procDirPropertyContexts == NULL) {
ERRDRV("out of memory\n");
@@ -340,7 +341,9 @@ EXPORT_SYMBOL_GPL(visor_proc_DestroyObject);
static int seq_show(struct seq_file *seq, void *offset)
{
- PROCDIRENTRYCONTEXT *ctx = (PROCDIRENTRYCONTEXT *)(seq->private);
+ struct proc_dir_entry_context *ctx;
+
+ ctx = (struct proc_dir_entry_context *)(seq->private);
if (ctx == NULL) {
ERRDRV("I don't have a freakin' clue...");
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] staging/unisys/visorutil/procobjecttree: Replace typedef
2015-02-02 18:26 ` [PATCH 2/2] staging/unisys/visorutil/procobjecttree: Replace typedef Ricardo Ribalda Delgado
@ 2015-02-02 18:32 ` Joe Perches
0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2015-02-02 18:32 UTC (permalink / raw)
To: Ricardo Ribalda Delgado
Cc: Masaru Nomura, Peter P Waskiewicz Jr, Tapasweni Pathak,
Iulia Manda, Catalina Mocanu, sparmaintainer, devel,
linux-kernel
On Mon, 2015-02-02 at 19:26 +0100, Ricardo Ribalda Delgado wrote:
> Instead of declaring a new type, define a new struct.
[]
> diff --git a/drivers/staging/unisys/visorutil/procobjecttree.c b/drivers/staging/unisys/visorutil/procobjecttree.c
[]
> @@ -340,7 +341,9 @@ EXPORT_SYMBOL_GPL(visor_proc_DestroyObject);
>
> static int seq_show(struct seq_file *seq, void *offset)
> {
> - PROCDIRENTRYCONTEXT *ctx = (PROCDIRENTRYCONTEXT *)(seq->private);
> + struct proc_dir_entry_context *ctx;
> +
> + ctx = (struct proc_dir_entry_context *)(seq->private);
seq-private is a void * and doesn't need to be cast here.
struct proc_dir_entry_context *ctx = seq->private;
should work well enough.
>
> if (ctx == NULL) {
> ERRDRV("I don't have a freakin' clue...");
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-02 18:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-02 18:26 [PATCH 0/2] Code Styte Ricardo Ribalda Delgado
2015-02-02 18:26 ` [PATCH 1/2] staging/unisys/visorutil/procobjecttree: Code Style Ricardo Ribalda Delgado
2015-02-02 18:26 ` [PATCH 2/2] staging/unisys/visorutil/procobjecttree: Replace typedef Ricardo Ribalda Delgado
2015-02-02 18:32 ` Joe Perches
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.