* [PATCH] regulator: core: Assign bool value to variable has_full_constraints
@ 2016-07-04 2:05 Baoquan He
2016-07-04 8:12 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Baoquan He @ 2016-07-04 2:05 UTC (permalink / raw)
To: lgirdwood, broonie; +Cc: linux-kernel, Baoquan He
In commit 21cf891a (regulator: Make regulator_has_full_constraints a bool)
type of variable has_full_constraints is changed to bool, so assign 'true'
to has_full_constraints here.
Signed-off-by: Baoquan He <bhe@redhat.com>
---
drivers/regulator/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index ec8184d5..a4f28b5 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4193,7 +4193,7 @@ EXPORT_SYMBOL_GPL(regulator_suspend_finish);
*/
void regulator_has_full_constraints(void)
{
- has_full_constraints = 1;
+ has_full_constraints = true;
}
EXPORT_SYMBOL_GPL(regulator_has_full_constraints);
--
2.5.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] regulator: core: Assign bool value to variable has_full_constraints
2016-07-04 2:05 [PATCH] regulator: core: Assign bool value to variable has_full_constraints Baoquan He
@ 2016-07-04 8:12 ` Mark Brown
2016-07-04 8:28 ` Baoquan He
2016-07-04 8:38 ` Baoquan He
0 siblings, 2 replies; 5+ messages in thread
From: Mark Brown @ 2016-07-04 8:12 UTC (permalink / raw)
To: Baoquan He; +Cc: lgirdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 490 bytes --]
On Mon, Jul 04, 2016 at 10:05:25AM +0800, Baoquan He wrote:
> In commit 21cf891a (regulator: Make regulator_has_full_constraints a bool)
> type of variable has_full_constraints is changed to bool, so assign 'true'
> to has_full_constraints here.
There is no need to make changes like this, C has full support for using
integers in a boolean context - using true here would've been just as
meaningful with an integer variable and using a number for a boolean
variable is fully equivalent.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] regulator: core: Assign bool value to variable has_full_constraints
2016-07-04 8:12 ` Mark Brown
@ 2016-07-04 8:28 ` Baoquan He
2016-07-04 8:38 ` Baoquan He
1 sibling, 0 replies; 5+ messages in thread
From: Baoquan He @ 2016-07-04 8:28 UTC (permalink / raw)
To: Mark Brown; +Cc: lgirdwood, linux-kernel
On 07/04/16 at 10:12am, Mark Brown wrote:
> On Mon, Jul 04, 2016 at 10:05:25AM +0800, Baoquan He wrote:
>
> > In commit 21cf891a (regulator: Make regulator_has_full_constraints a bool)
> > type of variable has_full_constraints is changed to bool, so assign 'true'
> > to has_full_constraints here.
>
> There is no need to make changes like this, C has full support for using
> integers in a boolean context - using true here would've been just as
> meaningful with an integer variable and using a number for a boolean
> variable is fully equivalent.
Well, I am fine with it. I am just going through pci/acpi initialization
code because I lack knowledge on them to fix a amd iommu bug. Trying to
post patches when some improvement can be made during this code reading
journey. If then, NACK it.
Thanks
Baoquan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] regulator: core: Assign bool value to variable has_full_constraints
2016-07-04 8:12 ` Mark Brown
2016-07-04 8:28 ` Baoquan He
@ 2016-07-04 8:38 ` Baoquan He
2016-07-04 9:09 ` Mark Brown
1 sibling, 1 reply; 5+ messages in thread
From: Baoquan He @ 2016-07-04 8:38 UTC (permalink / raw)
To: Mark Brown; +Cc: lgirdwood, linux-kernel
On 07/04/16 at 10:12am, Mark Brown wrote:
> On Mon, Jul 04, 2016 at 10:05:25AM +0800, Baoquan He wrote:
>
> > In commit 21cf891a (regulator: Make regulator_has_full_constraints a bool)
> > type of variable has_full_constraints is changed to bool, so assign 'true'
> > to has_full_constraints here.
>
> There is no need to make changes like this, C has full support for using
> integers in a boolean context - using true here would've been just as
> meaningful with an integer variable and using a number for a boolean
> variable is fully equivalent.
By the way, I still think it makes code more read-able to assign a bool
value to a bool variable. In your words, C truly has full support for
using integers in a boolean context, then commit 21cf891a is not
necessary to be made to change.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] regulator: core: Assign bool value to variable has_full_constraints
2016-07-04 8:38 ` Baoquan He
@ 2016-07-04 9:09 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2016-07-04 9:09 UTC (permalink / raw)
To: Baoquan He; +Cc: lgirdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 442 bytes --]
On Mon, Jul 04, 2016 at 04:38:26PM +0800, Baoquan He wrote:
> By the way, I still think it makes code more read-able to assign a bool
> value to a bool variable. In your words, C truly has full support for
> using integers in a boolean context, then commit 21cf891a is not
> necessary to be made to change.
The feedback here is largely about the commit message - it's written
like it's fixing a bug but it's really just a stylistic change.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-07-04 9:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-04 2:05 [PATCH] regulator: core: Assign bool value to variable has_full_constraints Baoquan He
2016-07-04 8:12 ` Mark Brown
2016-07-04 8:28 ` Baoquan He
2016-07-04 8:38 ` Baoquan He
2016-07-04 9:09 ` Mark Brown
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).