From: Gavin Shan <shangw@linux.vnet.ibm.com>
To: David Laight <David.Laight@aculab.com>
Cc: linuxppc-dev@lists.ozlabs.org, Gavin Shan <shangw@linux.vnet.ibm.com>
Subject: Re: [PATCH 3/6] powerpc/powernv: Replace variables with flags
Date: Wed, 26 Jun 2013 18:08:14 +0800 [thread overview]
Message-ID: <20130626100814.GA22174@shangw.(null)> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B72A6@saturn3.aculab.com>
On Wed, Jun 26, 2013 at 10:12:16AM +0100, David Laight wrote:
>> We have 2 fields in "struct pnv_phb" to trace the states. The patch
>> replace the fields with one and introduces flags for that. The patch
>> doesn't impact the logic.
>
>What is the benefit of this change?
>
There might have more flags coming in. Putting all flags together
could be maintained more easily. It doesn't save much memory as
you pointed.
>> +
>> +#define PNV_EEH_STATE_ENABLED (1 << 0) /* EEH enabled */
>> +#define PNV_EEH_STATE_REMOVED (1 << 1) /* PHB removed */
>> +
>> #endif /* CONFIG_EEH */
>>
>> struct pnv_phb {
>> @@ -92,8 +96,7 @@ struct pnv_phb {
>>
>> #ifdef CONFIG_EEH
>> struct pnv_eeh_ops *eeh_ops;
>> - int eeh_enabled;
>> - int removed;
>> + int eeh_state;
>> #endif
>>
>> #ifdef CONFIG_DEBUG_FS
>
>All I can see is that it possibly reduces a structure by 4 bytes
>while adding extra code.
>(On 64 bit systems there might be a 4 byte pad added.)
>
Thanks,
Gavin
next prev parent reply other threads:[~2013-06-26 10:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-26 1:38 [PATCH v3 00/6] Follow-up fixes for EEH on PowerNV Gavin Shan
2013-06-26 1:38 ` [PATCH 1/6] powerpc/eeh: Don't collect PCI-CFG data on PHB Gavin Shan
2013-06-26 1:38 ` [PATCH 2/6] powerpc/eeh: Check PCIe link after reset Gavin Shan
2013-06-26 1:38 ` [PATCH 3/6] powerpc/powernv: Replace variables with flags Gavin Shan
2013-06-26 9:12 ` David Laight
2013-06-26 10:08 ` Gavin Shan [this message]
2013-06-26 1:38 ` [PATCH 4/6] powerpc/eeh: Fix address catch for PowerNV Gavin Shan
2013-06-26 1:38 ` [PATCH 5/6] powerpc/eeh: Refactor the output message Gavin Shan
2013-06-26 1:38 ` [PATCH 6/6] powerpc/eeh: Avoid build warnings Gavin Shan
-- strict thread matches above, loose matches on Subject: below --
2013-06-25 10:00 [PATCH v2 00/6] Follow-up fixes for EEH on PowerNV Gavin Shan
2013-06-25 10:00 ` [PATCH 3/6] powerpc/powernv: Replace variables with flags Gavin Shan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='20130626100814.GA22174@shangw.(null)' \
--to=shangw@linux.vnet.ibm.com \
--cc=David.Laight@aculab.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).