Print this page
11506 smatch resync
*** 519,528 ****
--- 519,537 ----
if (!is_struct_tag(basetype, tag))
sm_error("'%%p%c' expects argument of type struct '%s*', argument %d has type '%s'",
fmt[0], tag, vaidx, type_to_str(type));
}
+ static void time_and_date(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
+ {
+ assert(tolower(fmt[0]) == 't');
+
+ if (fmt[1] == 'R' && !is_struct_tag(basetype, "rtc_time"))
+ sm_error("'%%ptR' expects argument of type struct 'rtc_time', argument %d has type '%s'",
+ vaidx, type_to_str(type));
+ }
+
static void check_clock(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
{
assert(fmt[0] == 'C');
if (isalnum(fmt[1])) {
if (!strchr("nr", fmt[1]))
*** 754,763 ****
--- 763,775 ----
break;
case 'D':
case 'd':
dentry_file(fmt, type, basetype, vaidx);
break;
+ case 't':
+ time_and_date(fmt, type, basetype, vaidx);
+ break;
case 'C':
check_clock(fmt, type, basetype, vaidx);
break;
case 'g':
block_device(fmt, type, basetype, vaidx);