Re: [PATCH/RFC] staging: dwc: Moving all hwcfg accesses to one place

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 27, 2013 at 10:48:17AM +0100, Matthijs Kooijman wrote:
> Hi folks,
> 
> while going through the dwc2 driver, I've found that there is a lot of
> places that need info from the hwcfg registers. Currently, each of these
> places do their own bitshifting and masking, but it occurs to me that
> the code would become cleaner if all this happened in single place, so
> all the other spots can just refer to a proper variable instead.
> 
> I've made a start at implementing this, but before I finish up this
> patch, I'd like to know what other people think. Is this a good idea, or
> would you prefer to keep it like this?
> 
> The advantage of this patch would be that the code is more clear. The
> disadvantage is a couple of dozen bytes of extra memory used (though
> this could be reduced to just a few to no bytes by using bitfields to
> store the values instead, if preferred). Another disadvantage could be
> that it would be a pretty big, but simple, patch to review.

Then do it one bit at a time (sorry, bad pun...)

But yes, it does seem to be a good idea, as long as these options can't
change over time.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux