Consolidate fprintf statements
Doing one item per call is like old MODULA2 code.
This commit is contained in:
parent
8007bfb5ad
commit
8a1c7fcb27
78
ip/ipxfrm.c
78
ip/ipxfrm.c
|
|
@ -351,16 +351,12 @@ void xfrm_stats_print(struct xfrm_stats *s, FILE *fp, const char *prefix)
|
||||||
{
|
{
|
||||||
if (prefix)
|
if (prefix)
|
||||||
fputs(prefix, fp);
|
fputs(prefix, fp);
|
||||||
fprintf(fp, "stats:");
|
fprintf(fp, "stats:%s", _SL_);
|
||||||
fprintf(fp, "%s", _SL_);
|
|
||||||
|
|
||||||
if (prefix)
|
if (prefix)
|
||||||
fputs(prefix, fp);
|
fputs(prefix, fp);
|
||||||
fprintf(fp, " ");
|
fprintf(fp, " replay-window %u replay %u failed %u%s",
|
||||||
fprintf(fp, "replay-window %u ", s->replay_window);
|
s->replay_window, s->replay, s->integrity_failed, _SL_);
|
||||||
fprintf(fp, "replay %u ", s->replay);
|
|
||||||
fprintf(fp, "failed %u", s->integrity_failed);
|
|
||||||
fprintf(fp, "%s", _SL_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *strxf_time(__u64 time)
|
static const char *strxf_time(__u64 time)
|
||||||
|
|
@ -392,72 +388,52 @@ void xfrm_lifetime_print(struct xfrm_lifetime_cfg *cfg,
|
||||||
if (cfg) {
|
if (cfg) {
|
||||||
if (prefix)
|
if (prefix)
|
||||||
fputs(prefix, fp);
|
fputs(prefix, fp);
|
||||||
fprintf(fp, "lifetime config:");
|
fprintf(fp, "lifetime config:%s",_SL_);
|
||||||
fprintf(fp, "%s", _SL_);
|
|
||||||
|
|
||||||
if (prefix)
|
if (prefix)
|
||||||
fputs(prefix, fp);
|
fputs(prefix, fp);
|
||||||
fprintf(fp, " ");
|
fprintf(fp, " limit: soft %s(bytes),",
|
||||||
fprintf(fp, "limit: ");
|
strxf_limit(cfg->soft_byte_limit));
|
||||||
fprintf(fp, "soft ");
|
fprintf(fp, " hard %s(bytes)%s",
|
||||||
fprintf(fp, strxf_limit(cfg->soft_byte_limit));
|
strxf_limit(cfg->hard_byte_limit), _SL_);
|
||||||
fprintf(fp, "(bytes), hard ");
|
|
||||||
fprintf(fp, strxf_limit(cfg->hard_byte_limit));
|
|
||||||
fprintf(fp, "(bytes)");
|
|
||||||
fprintf(fp, "%s", _SL_);
|
|
||||||
|
|
||||||
if (prefix)
|
if (prefix)
|
||||||
fputs(prefix, fp);
|
fputs(prefix, fp);
|
||||||
fprintf(fp, " ");
|
fprintf(fp, " limit: soft %s(packets),",
|
||||||
fprintf(fp, "limit: ");
|
strxf_limit(cfg->soft_packet_limit));
|
||||||
fprintf(fp, "soft ");
|
fprintf(fp, " hard %s(packets)%s",
|
||||||
fprintf(fp, strxf_limit(cfg->soft_packet_limit));
|
strxf_limit(cfg->hard_packet_limit), _SL_);
|
||||||
fprintf(fp, "(packets), hard ");
|
|
||||||
fprintf(fp, strxf_limit(cfg->hard_packet_limit));
|
|
||||||
fprintf(fp, "(packets)");
|
|
||||||
fprintf(fp, "%s", _SL_);
|
|
||||||
|
|
||||||
if (prefix)
|
if (prefix)
|
||||||
fputs(prefix, fp);
|
fputs(prefix, fp);
|
||||||
fprintf(fp, " ");
|
fprintf(fp, " expire add: soft %llu(sec), hard %llu(sec)%s",
|
||||||
fprintf(fp, "expire add: ");
|
(unsigned long long) cfg->soft_add_expires_seconds,
|
||||||
fprintf(fp, "soft ");
|
(unsigned long long) cfg->hard_add_expires_seconds,
|
||||||
fprintf(fp, "%llu", (unsigned long long) cfg->soft_add_expires_seconds);
|
_SL_);
|
||||||
fprintf(fp, "(sec), hard ");
|
|
||||||
fprintf(fp, "%llu", (unsigned long long) cfg->hard_add_expires_seconds);
|
|
||||||
fprintf(fp, "(sec)");
|
|
||||||
fprintf(fp, "%s", _SL_);
|
|
||||||
|
|
||||||
if (prefix)
|
if (prefix)
|
||||||
fputs(prefix, fp);
|
fputs(prefix, fp);
|
||||||
fprintf(fp, " ");
|
fprintf(fp, " expire use: soft %llu(sec), hard %llu(sec)%s",
|
||||||
fprintf(fp, "expire use: ");
|
(unsigned long long) cfg->soft_use_expires_seconds,
|
||||||
fprintf(fp, "soft ");
|
(unsigned long long) cfg->hard_use_expires_seconds,
|
||||||
fprintf(fp, "%llu", (unsigned long long) cfg->soft_use_expires_seconds);
|
_SL_);
|
||||||
fprintf(fp, "(sec), hard ");
|
|
||||||
fprintf(fp, "%llu", (unsigned long long) cfg->hard_use_expires_seconds);
|
|
||||||
fprintf(fp, "(sec)");
|
|
||||||
fprintf(fp, "%s", _SL_);
|
|
||||||
}
|
}
|
||||||
if (cur) {
|
if (cur) {
|
||||||
if (prefix)
|
if (prefix)
|
||||||
fputs(prefix, fp);
|
fputs(prefix, fp);
|
||||||
fprintf(fp, "lifetime current:");
|
fprintf(fp, "lifetime current:%s", _SL_);
|
||||||
fprintf(fp, "%s", _SL_);
|
|
||||||
|
|
||||||
if (prefix)
|
if (prefix)
|
||||||
fputs(prefix, fp);
|
fputs(prefix, fp);
|
||||||
fprintf(fp, " ");
|
fprintf(fp, " %llu(bytes), %llu(packets)%s",
|
||||||
fprintf(fp, "%llu(bytes), ", (unsigned long long) cur->bytes);
|
(unsigned long long) cur->bytes,
|
||||||
fprintf(fp, "%llu(packets)", (unsigned long long) cur->packets);
|
(unsigned long long) cur->packets,
|
||||||
fprintf(fp, "%s", _SL_);
|
_SL_);
|
||||||
|
|
||||||
if (prefix)
|
if (prefix)
|
||||||
fputs(prefix, fp);
|
fputs(prefix, fp);
|
||||||
fprintf(fp, " ");
|
fprintf(fp, " add %s ", strxf_time(cur->add_time));
|
||||||
fprintf(fp, "add %s ", strxf_time(cur->add_time));
|
fprintf(fp, "use %s%s", strxf_time(cur->use_time), _SL_);
|
||||||
fprintf(fp, "use %s", strxf_time(cur->use_time));
|
|
||||||
fprintf(fp, "%s", _SL_);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue