LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/4] int to bool conversion
@ 2015-01-22  8:49 Quentin Lambert
  2015-01-22 16:18 ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Quentin Lambert @ 2015-01-22  8:49 UTC (permalink / raw)
  To: Zhang Rui, Robert Moore, Lv Zheng, Rafael J. Wysocki, Len Brown,
	Shaohua Li
  Cc: linux-acpi, devel, linux-kernel

These patches convert local variables from int to bool when relevant.

The first patch proposes straight forward cases where the conversion
do not suggest changes beyond the function.

The second patch deals with cases where the conversion is propagated
to function parameters.

The third patch is a single case where the variable is given as a
parameter to a kernel macro.

Finally, the fourth patch is a case in which the conversion is
propagated to the field of a structure.


Quentin Lambert (4):
  ACPI: Convert non-returned local variable to boolean when relevant
  ACPI: Convert int variable to bool and propagate to function
    parameters
  ACPI: Convert int to bool for variable later used int kernel macro
  ACPI: Convert int to bool and propagete to struct field

 drivers/acpi/acpi_pad.c         |  6 +++---
 drivers/acpi/acpi_processor.c   |  5 +++--
 drivers/acpi/acpica/acutils.h   |  3 ++-
 drivers/acpi/acpica/utaddress.c |  3 ++-
 drivers/acpi/acpica/utstring.c  | 10 +++++-----
 drivers/acpi/acpica/utxface.c   |  2 +-
 drivers/acpi/dock.c             |  4 ++--
 drivers/acpi/osl.c              |  4 ++--
 drivers/acpi/pci_link.c         |  4 ++--
 drivers/acpi/processor_core.c   | 12 ++++++------
 drivers/acpi/processor_pdc.c    |  5 +++--
 drivers/acpi/scan.c             |  4 ++--
 drivers/acpi/thermal.c          | 10 +++++-----
 13 files changed, 38 insertions(+), 34 deletions(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [PATCH 0/4] int to bool conversion
@ 2015-01-30 17:32 Louis Langholtz
  2015-01-30 18:21 ` Peter Hurley
  0 siblings, 1 reply; 7+ messages in thread
From: Louis Langholtz @ 2015-01-30 17:32 UTC (permalink / raw)
  To: linux-kernel

While it may not be productive to perturb seemingly working
code (as Rafael argues), it may also not be productive to
have decreased code readability (as Quentin suggests).

Personally I prefer readability enhancements over worrying
about possibly breaking working code. I don't want to start
a flame war so I won't go into arguing this as a better
position. I'd just like to thank Quentin for his efforts to
identify boolean uses of variables. It's something I'm
interested in as well and have been working on in a branch
of my own git repository.

Quentin if you want to work on this together at all, that'd
be great. Please contact me directly as I'm not subscribed to
the LKML. As for the original semantic patch code, it's
unlikely that it would be safe to not exclude variables that
are passed by address (and seemingly the ampersand operator
applied on x - as in '&x' - should be a part of the exclusion
set).

Lou

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-02-18 19:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-22  8:49 [PATCH 0/4] int to bool conversion Quentin Lambert
2015-01-22 16:18 ` Rafael J. Wysocki
2015-01-26  8:30   ` Quentin Lambert
2015-01-26 13:32     ` Rafael J. Wysocki
2015-02-18 19:09       ` Moore, Robert
2015-01-30 17:32 Louis Langholtz
2015-01-30 18:21 ` Peter Hurley

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).