From: Peter Stuge Date: Tue, 24 Jul 2012 03:47:25 +0200 Subject: [ath9k-devel] [PATCH] qca-swiss-army-knife: Add a tool to dump EEPROM In-Reply-To: <20493.63087.260070.398504@gargle.gargle.HOWL> References: <20492.53272.943747.11705@gargle.gargle.HOWL> <20120723210854.28601.qmail@stuge.se> <20493.63087.260070.398504@gargle.gargle.HOWL> Message-ID: <20120724014725.23202.qmail@stuge.se> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org Sujith Manoharan wrote: > > What is the define+undef about in each of these fill functions? I > > guess there could be a better solution for these sizes? > > > > Even writing out sizeof(struct ar5416_eeprom_4k) / sizeof(uint16_t) > > in the loop condition would be an improvement IMO. > > How would that make the code more readable ? It is obvious, and mixing cc scope (functions) with cpp (#define) is not. > > > + PR("Ant Chain 0", "0x", "X", pModal->antCtrlChain[0]); > > > + PR("Antenna Common", "0x", "X", pModal->antCtrlCommon); > > > + PR("Antenna Gain Chain 0", "", "d", pModal->antennaGainCh[0]); > > ..followed by 44 more lines with second and third parameter > > identical. What do you think about having two macros instead? > > Care to show how ? Yes. > > > +#define PR(_token, _p, _val_fmt, _val) \ .. > > Yeah baby. Got another one! > > Um, I am not sure what you are getting at ?. The macros are horrible. > just a macro to handle all that.. The point is that making it a single macro (wait, three!) was a bad idea. > But, patches are always welcome to improve things. Sure. There are different responses to critical review. edump is a trivial utility but I'm anyway surprised about the fast and loose merge finger, since that leads to the above disinterest in critique. //Peter