From patchwork Mon Mar 19 00:36:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Lyle X-Patchwork-Id: 10291481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EA1D760291 for ; Mon, 19 Mar 2018 00:37:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD40A28D4B for ; Mon, 19 Mar 2018 00:37:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1DF428F56; Mon, 19 Mar 2018 00:37:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F48728D4B for ; Mon, 19 Mar 2018 00:37:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754825AbeCSAhF (ORCPT ); Sun, 18 Mar 2018 20:37:05 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:40177 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754823AbeCSAg5 (ORCPT ); Sun, 18 Mar 2018 20:36:57 -0400 Received: by mail-pl0-f65.google.com with SMTP id x4-v6so274802pln.7 for ; Sun, 18 Mar 2018 17:36:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lyle-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fLi6/Z20IHSRBrifaxoDMU4AoSPQG1gfTC9rrPUyDBc=; b=qwue1ML2o3g17yhsh8ph6PGfNNhlrjU8rtWg2CnuFhgtIkhnm43ojncDuLVwIAnTwl GtTIfd51hQvkpCQRuIQrGcIeu+7KONUL8X2QX0cYdLXIYOBpfPfvZqGmv3v4XJvB5s+0 mkty0qBz8wIO59iShVyf7taXs7/MEVQ2TZ+SlNP7+I4pPAAJG3y6taVzxOUIxhHDSZFR xMyCtvV1oSWRI0Jpo0ExoSZFfmRieR+U5k4/ZL4W1MChPHLEmZiYrCY8eL6sZcih3dV1 Z5ToaWt0VNahjyjqjfPgh8jKUG6IqeaWLl1LlXpXmbS4XEqkj6xoYJPppzDPJPhlThqF 3xDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fLi6/Z20IHSRBrifaxoDMU4AoSPQG1gfTC9rrPUyDBc=; b=Y448+viYpN09c8RsIgnreW9CEC/cnDn3Z9wjabw3rBFgBnKa8k6AO7QZ+6qmSjELgh +nOXJuKOLPL9/xHV4IJekn9P3G29AgRzc5X8ZALkz4LfmbRkr4RZSEzTOryiE81vm/Lz 0NyshgAlmbsy4Tnxe9sAQNhbTYuyhcJKEeN8OrQ5wiQggiue2MRQbA7QSXidpONF2V4v MqAdcR8+MW0f+RYlzwdRmC22hNsPi4HVYCEue+pswHX2eJu/opp6N8QHG6s5Hl3qyJD8 Xg+XSqJXUs3YCIVieSVkc30uyBIN9XtLfAkTvI7FD4jdYyZFFak8AndY5fkHkcbsNOWN Gqfg== X-Gm-Message-State: AElRT7H8nSBs38ls+HvnKKj9tEF0IHNCxJwRLbsDMtdsw5mP+Tlo05do GkuLwO4njQtGqiSeNu2B8TGJ0MuQVEs= X-Google-Smtp-Source: AG47ELvo5N3OkJjXeko7SYFw43Bs8IiU1Xxt3NRXdnjIZk277vG0zDFmmm/T1TKo7x1vrmZ9ru3yUQ== X-Received: by 2002:a17:902:86:: with SMTP id a6-v6mr5943252pla.165.1521419817168; Sun, 18 Mar 2018 17:36:57 -0700 (PDT) Received: from midnight.lan (2600-6c52-6200-09b7-0000-0000-0000-0d66.dhcp6.chtrptr.net. [2600:6c52:6200:9b7::d66]) by smtp.gmail.com with ESMTPSA id a17sm27674857pfc.122.2018.03.18.17.36.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Mar 2018 17:36:56 -0700 (PDT) From: Michael Lyle To: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org Cc: axboe@fb.com, Bart Van Assche Subject: [for-4.17 14/20] bcache: Add __printf annotation to __bch_check_keys() Date: Sun, 18 Mar 2018 17:36:27 -0700 Message-Id: <20180319003633.27225-15-mlyle@lyle.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180319003633.27225-1-mlyle@lyle.org> References: <20180319003633.27225-1-mlyle@lyle.org> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bart Van Assche Make it possible for the compiler to verify the consistency of the format string passed to __bch_check_keys() and the arguments that should be formatted according to that format string. Signed-off-by: Bart Van Assche Reviewed-by: Michael Lyle --- drivers/md/bcache/bset.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/md/bcache/bset.h b/drivers/md/bcache/bset.h index fa506c1aa524..0c24280f3b98 100644 --- a/drivers/md/bcache/bset.h +++ b/drivers/md/bcache/bset.h @@ -531,14 +531,15 @@ int __bch_keylist_realloc(struct keylist *, unsigned); #ifdef CONFIG_BCACHE_DEBUG int __bch_count_data(struct btree_keys *); -void __bch_check_keys(struct btree_keys *, const char *, ...); +void __printf(2, 3) __bch_check_keys(struct btree_keys *, const char *, ...); void bch_dump_bset(struct btree_keys *, struct bset *, unsigned); void bch_dump_bucket(struct btree_keys *); #else static inline int __bch_count_data(struct btree_keys *b) { return -1; } -static inline void __bch_check_keys(struct btree_keys *b, const char *fmt, ...) {} +static inline void __printf(2, 3) + __bch_check_keys(struct btree_keys *b, const char *fmt, ...) {} static inline void bch_dump_bucket(struct btree_keys *b) {} void bch_dump_bset(struct btree_keys *, struct bset *, unsigned);