Thread (28 messages) 28 messages, 4 authors, 2015-07-23

Re: [PATCH v5 4/7] powerpc/powernv: detect supported nest pmus and its events

From: Madhavan Srinivasan <hidden>
Date: 2015-07-23 09:24:30
Also in: lkml


On Thursday 23 July 2015 02:41 PM, Michael Ellerman wrote:
On Thu, 2015-07-23 at 11:33 +0530, Madhavan Srinivasan wrote:
quoted
On Wednesday 22 July 2015 09:37 AM, Daniel Axtens wrote:
quoted
 
quoted
 static struct perchip_nest_info p8_nest_perchip_info[P8_NEST_MAX_CHIPS];
+static struct nest_pmu *per_nest_pmu_arr[P8_NEST_MAX_PMUS];
+
+static int nest_event_info(struct property *pp, char *name,
+			struct nest_ima_events *p8_events, int string, u32 val)
'int string' is a bit confusing. 'bool is_string' might be clearer, but
I think it would be even better still to have different functions for
string and non-string cases, especially because you only need val in the
non-string case.
I would perfer to be a single function, since most of the code is same
just of the sting or val part. yes. We can make is as is_string and will
add comment explaining what is done here? 
I think Daniel's right, it would be better as two functions.

The only part that is common after the if (string) check is the
p8_events->ev_value = buf assignment.

So you should be able to keep all the code up to the if (string) check in a
shared function and just have two wrappers that use it.

cheers
Sure. Will do.

Maddy

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help