[PATCH 4/4] Documentation: fix misc. warnings
From: Peter Foley
Date: Thu Apr 17 2014 - 10:12:57 EST
Fix a few warnings that gcc emits during a default build.
Signed-off-by: Peter Foley <pefoley2@xxxxxxxxxxx>
---
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, ¶m);
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/