Thread (7 messages) 7 messages, 2 authors, 2012-11-14

Re: [PATCH 1/4] adapter: Convert storage aliases

flat view

From: Frederic Danis <hidden>
Date: 2012-11-14 11:04:39

Hello Johan,

On 14/11/2012 11:45, Johan Hedberg wrote:
Hi Frederic,

On Wed, Nov 14, 2012, Frédéric Danis wrote:
quoted
  #define SETTINGS_PATH STORAGEDIR "/%s/settings"
  #define CACHE_PATH STORAGEDIR "/%s/cache/%s"
+#define DEVICE_INFO_PATH STORAGEDIR "/%s/%s/info"
Why do you have these separate defines? Do you need them in multiple
places? The define names are longer than the actual values and you're
just obfuscating the actual call that uses them (since you need to look
in two places to figure out of the format parameters are actually
matching the format string). So please don't use these.
CACHE_PATH and DEVICE_INFO_PATH are only used in one place, so they can be removed.

SETTINGS_PATH is used in both store_adapter_info() and load_config(), so I think it is better to keep it.

Fred


-- 
Frederic Danis                            Open Source Technology Center
frederic.danis@intel.com                              Intel Corporation
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help