Linux-Modules Archive on lore.kernel.org
 help / color / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: linux-modules@vger.kernel.org
Cc: James Minor <james.minor@ni.com>,
	julia.cartwright@ni.com, zach.brown@ni.com, ken.sharp@ni.com
Subject: [PATCH 1/2] libkmod-config: replace 0/1 with bool
Date: Thu, 16 Feb 2017 09:28:30 -0800
Message-ID: <20170216172831.3019-1-lucas.demarchi@intel.com> (raw)

---
 libkmod/libkmod-config.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index 0596025..18f300a 100644
--- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c
@@ -496,8 +496,8 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
 {
 	char buf[KCMD_LINE_SIZE];
 	int fd, err;
-	char *p, *modname,  *param = NULL, *value = NULL, is_module = 1;
-	bool is_quoted = false;
+	char *p, *modname,  *param = NULL, *value = NULL;
+	bool is_quoted = false, is_module = true;
 
 	fd = open("/proc/cmdline", O_RDONLY|O_CLOEXEC);
 	if (fd < 0) {
@@ -528,7 +528,7 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
 				kcmdline_parse_result(config, modname, param, value);
 			param = value = NULL;
 			modname = p + 1;
-			is_module = 1;
+			is_module = true;
 			break;
 		case '.':
 			if (param == NULL) {
@@ -540,7 +540,7 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
 			if (param != NULL)
 				value = p + 1;
 			else
-				is_module = 0;
+				is_module = false;
 			break;
 		}
 	}
-- 
2.9.3


             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16 17:28 Lucas De Marchi [this message]
2017-02-16 17:28 ` [PATCH 2/2] libkmod-config: fix parsing quoted kernel cmdline on params Lucas De Marchi
2017-02-23 22:14   ` Lucas De Marchi

Reply instructions:

You may reply publically 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=20170216172831.3019-1-lucas.demarchi@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=james.minor@ni.com \
    --cc=julia.cartwright@ni.com \
    --cc=ken.sharp@ni.com \
    --cc=linux-modules@vger.kernel.org \
    --cc=zach.brown@ni.com \
    /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

Linux-Modules Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-modules/0 linux-modules/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-modules linux-modules/ https://lore.kernel.org/linux-modules \
		linux-modules@vger.kernel.org linux-modules@archiver.kernel.org
	public-inbox-index linux-modules


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-modules


AGPL code for this site: git clone https://public-inbox.org/ public-inbox