Hello BenoƮt,

On Wed, 23 Feb 2011, Cousson, Benoit wrote:
> On 2/23/2011 8:11 AM, Paul Walmsley wrote:
> > +   /*
> > +    * XXX Rather than doing a strcmp(), this should test a flag
> > +    * set in the hwmod data, inserted by the autogenerator code.
> 
> What do you mean exactly? Something like a "is_mpu" field set to true 
> for the mpu? Since we are enforcing a consistent naming for every 
> hwmods, that looks like a duplication of the name. We will always named 
> this hwmod "mpu", so the strcmp() should be enough.
> 
> But, maybe I'm missing your point.

I had in mind adding a new flag bit for struct omap_hwmod.flags for this 
purpose, mostly for these reasons:

1. Russell indicated a preference to avoid strcmp() for this type of
   situation during the clock code merge a few years ago

2. Testing a single bit is much more efficient than calling strcmp(), 
   which will hopefully make life a little easier when running on an 
   FPGA emulator

A separate field would of course work as well, but seems more heavyweight 
if there's only one special case.

> > +    */
> > +   if (!strcmp(oh->name, MPU_INITIATOR_NAME))
> > +           mpu_oh = oh;
> > 
> > -   return ret;
> > +   return 0;
> >   }


- Paul

Reply via email to