mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Foley <pefoley2@pefoley.com>
To: linux-kernel@vger.kernel.org
Cc: rdunlap@infradead.org, linux-doc@vger.kernel.org,
	Peter Foley <pefoley2@pefoley.com>
Subject: [PATCH 4/4] Documentation: fix misc. warnings
Date: Thu, 17 Apr 2014 10:11:50 -0400	[thread overview]
Message-ID: <1397743910-18391-4-git-send-email-pefoley2@pefoley.com> (raw)
In-Reply-To: <1397743910-18391-1-git-send-email-pefoley2@pefoley.com>

Fix a few warnings that gcc emits during a default build.

Signed-off-by: Peter Foley <pefoley2@pefoley.com>
---
 Documentation/laptops/hpfall.c  | 9 +++++++--
 Documentation/mic/mpssd/mpssd.c | 4 ++--
 Documentation/ptp/testptp.c     | 6 +++---
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/Documentation/laptops/hpfall.c b/Documentation/laptops/hpfall.c
index d4e1380..3e04fc1 100644
--- a/Documentation/laptops/hpfall.c
+++ b/Documentation/laptops/hpfall.c
@@ -74,14 +74,16 @@ static void protect(int seconds)
 static int on_ac(void)
 {
 //	/sys/class/power_supply/AC0/online
+	return 0;
 }
 
 static int lid_open(void)
 {
 //	/proc/acpi/button/lid/LID/state
+	return 0;
 }
 
-static void ignore_me(void)
+static void ignore_me(int ignored)
 {
 	protect(0);
 	set_led(0);
@@ -111,7 +113,10 @@ int main(int argc, char **argv)
 		return EXIT_FAILURE;
 	}
 
-	daemon(0, 0);
+	if (daemon(0, 0) < 0) {
+		perror("daemonization failed");
+		return EXIT_FAILURE;
+	}
 	param.sched_priority = sched_get_priority_max(SCHED_FIFO);
 	sched_setscheduler(0, SCHED_FIFO, &param);
 	mlockall(MCL_CURRENT|MCL_FUTURE);
diff --git a/Documentation/mic/mpssd/mpssd.c b/Documentation/mic/mpssd/mpssd.c
index 4d17487..24203dd 100644
--- a/Documentation/mic/mpssd/mpssd.c
+++ b/Documentation/mic/mpssd/mpssd.c
@@ -1476,9 +1476,9 @@ set_cmdline(struct mic_info *mic)
 
 	len = snprintf(buffer, PATH_MAX,
 		"clocksource=tsc highres=off nohz=off ");
-	len += snprintf(buffer + len, PATH_MAX,
+	len += snprintf(buffer + len, PATH_MAX - len,
 		"cpufreq_on;corec6_off;pc3_off;pc6_off ");
-	len += snprintf(buffer + len, PATH_MAX,
+	len += snprintf(buffer + len, PATH_MAX - len,
 		"ifcfg=static;address,172.31.%d.1;netmask,255.255.255.0",
 		mic->id);
 
diff --git a/Documentation/ptp/testptp.c b/Documentation/ptp/testptp.c
index f1ac2da..913b7ba 100644
--- a/Documentation/ptp/testptp.c
+++ b/Documentation/ptp/testptp.c
@@ -497,11 +497,11 @@ int main(int argc, char *argv[])
 			interval = t2 - t1;
 			offset = (t2 + t1) / 2 - tp;
 
-			printf("system time: %" PRId64 ".%u\n",
+			printf("system time: %lld.%u\n",
 				(pct+2*i)->sec, (pct+2*i)->nsec);
-			printf("phc    time: %" PRId64 ".%u\n",
+			printf("phc    time: %lld.%u\n",
 				(pct+2*i+1)->sec, (pct+2*i+1)->nsec);
-			printf("system time: %" PRId64 ".%u\n",
+			printf("system time: %lld.%u\n",
 				(pct+2*i+2)->sec, (pct+2*i+2)->nsec);
 			printf("system/phc clock time offset is %" PRId64 " ns\n"
 			       "system     clock time delay  is %" PRId64 " ns\n",
-- 
1.9.2


  parent reply	other threads:[~2014-04-17 14:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17 14:11 [PATCH 1/4] Documentation: use subdir-y to avoid unnecessary built-in.o files Peter Foley
2014-04-17 14:11 ` [PATCH 2/4] Documentation: add makefiles for more targets Peter Foley
2014-08-26 16:50   ` Andrey Wagin
2014-04-17 14:11 ` [PATCH 3/4] Documentation: make functions static to avoid prototype warnings Peter Foley
2014-04-17 14:11 ` Peter Foley [this message]
2014-06-29  2:23 ` [PATCH 1/4] Documentation: use subdir-y to avoid unnecessary built-in.o files Randy Dunlap
2014-07-09 20:52   ` Sam Ravnborg
2014-08-25 20:33 ` Randy Dunlap
2014-09-02 22:58   ` Peter Foley
2014-09-02 23:24     ` Randy Dunlap
2014-09-02 23:29       ` Mark Brown
2014-09-03 23:08         ` Peter Foley
2014-09-03 23:21           ` Mark Brown
2014-09-03 23:38             ` Randy Dunlap
2014-09-03 23:49               ` Mark Brown
2014-09-04 10:42               ` Mark Brown
2014-09-06  0:07                 ` Randy Dunlap
2014-09-07 17:59                   ` Randy Dunlap
2014-09-07 18:48                     ` Mark Brown
2014-09-07 20:52                       ` Randy Dunlap
2014-09-08  8:03                       ` Stephen Rothwell
2014-09-08 10:22                         ` Mark Brown
2014-09-08 14:57                           ` Stephen Rothwell

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=1397743910-18391-4-git-send-email-pefoley2@pefoley.com \
    --to=pefoley2@pefoley.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.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

all inboxes | Powered by JetHome®