From patchwork Sat Nov 24 04:29:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1002595 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="KzUw418Z"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4320t706jlz9s7W for ; Sat, 24 Nov 2018 15:43:10 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 9F5B6C22481; Sat, 24 Nov 2018 04:33:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B36F6C2246C; Sat, 24 Nov 2018 04:30:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DE247C2249F; Sat, 24 Nov 2018 04:30:35 +0000 (UTC) Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by lists.denx.de (Postfix) with ESMTPS id 8734FC2247D for ; Sat, 24 Nov 2018 04:30:30 +0000 (UTC) Received: by mail-qt1-f197.google.com with SMTP id w18so10439038qts.8 for ; Fri, 23 Nov 2018 20:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=xjdSqKf25K7nzJXuUlPzFzcclbFV6CuiYAfJfHhNAs8=; b=KzUw418ZLe4gVac8/hQV3qNBuQT4vcnV7cjypMeE1yxMOLhqtkH/2Xwca5/kOu3p5p zBmXuBNi/fjvOBNXMc4h17mgprcS9Lv8khYCmEApq4h4q5Nz4exaRCY5/PuHSqQF8aoS GhifIzUKucthvQMgn595CwFncNNXQsVE/5h/k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=xjdSqKf25K7nzJXuUlPzFzcclbFV6CuiYAfJfHhNAs8=; b=kHmtjwfO2fvn0AyJbI/ydlBMLF2yd/6CT/nVoNoG3MNUVQqme2jRNUN2ANUs7PeGYw uOlUaZe0T43BE/tP5+PieAhYxL7pfz2FSiGWfYuodPR8d5yHcIelxwcfbx1sUFZIVw4H mZwQODHm4P4gp0ChQUA2QigV3yWAn2KVTH/C9ElkHum1qdnbNesTr1I7C2kd1k0V3XlT s4SHrb1DkqEzNwu5wpb20FLB5jJQcGO1CkDJr0cXjAp3Y54vW+obK5bgpjL9wCcR4Daj 0LiDS+VLRzAw3NorOYKTTXvh1rlh4umpWmaeTbfr0BbpBa13gkOYVTvuvnOugUa4Ld9M W4Cg== X-Gm-Message-State: AA+aEWaLKGRlDFfGULB2iJ1VI9vBvqmUHaTX9r+fna1relBLWlEifrzk 7kSQBTy5WgCvXrosDk5n02Ev9795bsXOsubh X-Google-Smtp-Source: AJdET5dHcBUZQPvCIprMoJqHBI3llENboClnkVMjPbr8pu3XIsctf7HlSSS+jt0NmLt2gue8207CwJs/2a6RjoXh X-Received: by 2002:aed:35a4:: with SMTP id c33mr11356997qte.40.1543033829614; Fri, 23 Nov 2018 20:30:29 -0800 (PST) Date: Fri, 23 Nov 2018 21:29:41 -0700 In-Reply-To: <20181124042944.239106-1-sjg@chromium.org> Message-Id: <20181124042944.239106-19-sjg@chromium.org> Mime-Version: 1.0 References: <20181124042944.239106-1-sjg@chromium.org> X-Mailer: git-send-email 2.20.0.rc0.387.gc7a69e6b6c-goog From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt Subject: [U-Boot] [PATCH 18/21] log: Check printf() arguments X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present logging does not check printf() arguments. Now that all users have been corrected, enable this to prevent further problems. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- include/log.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/log.h b/include/log.h index 4f14937b7a2..310b2cf7ce5 100644 --- a/include/log.h +++ b/include/log.h @@ -73,7 +73,8 @@ static inline int log_uc_cat(enum uclass_id id) * @return 0 if log record was emitted, -ve on error */ int _log(enum log_category_t cat, enum log_level_t level, const char *file, - int line, const char *func, const char *fmt, ...); + int line, const char *func, const char *fmt, ...) + __attribute__ ((format (__printf__, 6, 7))); /* Define this at the top of a file to add a prefix to debug messages */ #ifndef pr_fmt