From patchwork Tue Oct 22 02:02:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcos Paulo de Souza X-Patchwork-Id: 11203407 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E5428139A for ; Tue, 22 Oct 2019 02:00:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C3D7D21928 for ; Tue, 22 Oct 2019 02:00:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="I4FiRu43" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387717AbfJVCAd (ORCPT ); Mon, 21 Oct 2019 22:00:33 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:33857 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730084AbfJVCAc (ORCPT ); Mon, 21 Oct 2019 22:00:32 -0400 Received: by mail-qt1-f193.google.com with SMTP id e14so4632203qto.1 for ; Mon, 21 Oct 2019 19:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=exC+Iu3uE8H1omtVa0Swd+N84x/kgFLsuUGXDgh1/5Y=; b=I4FiRu43IHYM4uD8V9YP3SLyCfVIjQpggJFlgW2Xlzwdf2ZwZU6EQLCBpJ0D2ObJMq dyZqnPa7q/3srzDalvIXtNA2GGVHpXnHkmvDIaWb8HfQZn2kd4C5S2xjIEdx0QirFK7/ 2NR2T5nY+NG2FG6V838WK9NcGErdvI2Is60xdhcCD2SB47I6V8k7bLtozHBnIs6AeQf7 ItW36+afAS6TrS349H11DmM+4IY8ig31KukNanqobiv9HxoAbyuduCh0iwglHgW0HqHT FHBwYnduoukHETtOAsGc8rIqK2HSm+MSdmBIjUETW1X9IA2ibe0OV+JuRzSvPaUE01LA JucA== 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:mime-version:content-transfer-encoding; bh=exC+Iu3uE8H1omtVa0Swd+N84x/kgFLsuUGXDgh1/5Y=; b=SUDbttptTSHx4lTlGet1RaI4VRsihWSl7DIhPPH9HaE62/sYHlyPN4M715ssh8tCv/ MndzYJEnFeA+bqVgBqapexh5YXex3k2eonrk+ZgH+6ds7Fu6M0ezHGO+PsSNDKUwT8KA 8X37mISF0vNcUO4u1mNM1EJQevSrWgtilsvIpZjmy/ZMYuWiR80Q4lLRa43oBcYGaaEs uBXnDmNW9XbIQNGxuf8jaN9bo0GPhPRlDWVUe0AMCGCQuiwTI+WT0H6o7bEOZTN2htOz iSy4rZF0+Ji17gu2Bc4v4ecoTZD6EjpY9NkPHLVBogfQs2X1QRG4DiqB+ObG5xD703cC erJw== X-Gm-Message-State: APjAAAV+OvA6IwfQg2ZA2iIWGtt74c79m2J1kjTz6XdrrN4FPKJsUct8 q3LHjojW30MbDjvZ8EtopQw= X-Google-Smtp-Source: APXvYqwT9oGRu0M0Y+l5bgBH097IeMHfng4sN5pBSW80X1Qbrqp65ELXMsKQrPC8UASmBQF8Jp8vzg== X-Received: by 2002:ac8:610e:: with SMTP id a14mr917382qtm.189.1571709630891; Mon, 21 Oct 2019 19:00:30 -0700 (PDT) Received: from localhost.localdomain (189.26.180.57.dynamic.adsl.gvt.net.br. [189.26.180.57]) by smtp.gmail.com with ESMTPSA id t65sm8511120qkh.23.2019.10.21.19.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 19:00:30 -0700 (PDT) From: Marcos Paulo de Souza To: dsterba@suse.com, linux-btrfs@vger.kernel.org Cc: Marcos Paulo de Souza Subject: [PATCH 1/2] btrfs-progs: utils: Replace __attribute__(fallthrough) Date: Mon, 21 Oct 2019 23:02:27 -0300 Message-Id: <20191022020228.14117-2-marcos.souza.org@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191022020228.14117-1-marcos.souza.org@gmail.com> References: <20191022020228.14117-1-marcos.souza.org@gmail.com> MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Marcos Paulo de Souza When compiling with clang, this warning is shown: common/utils.c:404:3: warning: declaration does not declare anything [-Wmissing-declarations] __attribute__ ((fallthrough)); This attribute seems to silence the same warning in GCC. Changing this attribute with /* fallthrough */ fixes the warning for both gcc and clang. Signed-off-by: Marcos Paulo de Souza --- common/utils.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/utils.c b/common/utils.c index 2cf15c33..a88336b3 100644 --- a/common/utils.c +++ b/common/utils.c @@ -401,15 +401,15 @@ int pretty_size_snprintf(u64 size, char *str, size_t str_size, unsigned unit_mod case UNITS_TBYTES: base *= mult; num_divs++; - __attribute__ ((fallthrough)); + /* fallthrough */ case UNITS_GBYTES: base *= mult; num_divs++; - __attribute__ ((fallthrough)); + /* fallthrough */ case UNITS_MBYTES: base *= mult; num_divs++; - __attribute__ ((fallthrough)); + /* fallthrough */ case UNITS_KBYTES: num_divs++; break; @@ -1135,14 +1135,14 @@ int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile, default: case 4: allowed |= BTRFS_BLOCK_GROUP_RAID10; - __attribute__ ((fallthrough)); + /* fallthrough */ case 3: allowed |= BTRFS_BLOCK_GROUP_RAID6; - __attribute__ ((fallthrough)); + /* fallthrough */ case 2: allowed |= BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_RAID5; - __attribute__ ((fallthrough)); + /* fallthrough */ case 1: allowed |= BTRFS_BLOCK_GROUP_DUP; } From patchwork Tue Oct 22 02:02:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcos Paulo de Souza X-Patchwork-Id: 11203409 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FF0A112B for ; Tue, 22 Oct 2019 02:00:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 342062166E for ; Tue, 22 Oct 2019 02:00:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hzaSX0zZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387820AbfJVCAg (ORCPT ); Mon, 21 Oct 2019 22:00:36 -0400 Received: from mail-qk1-f172.google.com ([209.85.222.172]:39888 "EHLO mail-qk1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730711AbfJVCAf (ORCPT ); Mon, 21 Oct 2019 22:00:35 -0400 Received: by mail-qk1-f172.google.com with SMTP id 4so14803698qki.6 for ; Mon, 21 Oct 2019 19:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/NZh7/4tliLAQTguKTusOm8JYsA9jfNfBnr9RwOlB0U=; b=hzaSX0zZglVTL84ewU00AKN1PkwcXT67jz51k9NFhFWE9CTcacRO4Pu5EOMCX7iKfo XtGjOZzqG6H91m13YCUXEtkP/henxO3SQM2YrmZwmWsIlZoccAnWGb/Fi/DYsXszJBqE D9nw5VuoS14aGqzwFSRJhO/vbPRYBdf+mv3yA1/jj7SWer842mTuPnZmNgLYT1ZR/c/m TpEptirfpOigJrWoqb+kEEoMv3ZbR3U3zrUSTbLcOstjnVxgHvbyjknyz1WsNCoRGZux xBS1OW9J8ALIhHjOHv5ERY0aKKWoK3eT3kvwnhuVEAlZAu6E4xlFNTLdEhjy1k2/I0ne 5xUA== 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:mime-version:content-transfer-encoding; bh=/NZh7/4tliLAQTguKTusOm8JYsA9jfNfBnr9RwOlB0U=; b=LdxoBbsEQ/a4ZZhtbZaINcW140qVN6iQgmWFvAaPOunf/B+VvHkxrZMGfJS7Sb/XpY b5OxdIWmXO/TML5YsYjE+6v1Nqu7e5vFtbM08fQMO0WK38auZ3/WqxxJjzP7oVSaoG6F /FGiv4GaMRioao9+gWJTntjLM0kkf6k3tAKs9uAZj+is4lN+0z2ZILckTUjNADasBQpj TXWTAw5Idj8eOCQV9Z581Xnror+G8W+Cyfg7l2NxUMzBe4GtOwWRbT/1apnNHojOavqM ZKN1kGV3OxGK2RKl3ykhVdB8gD/yQf5/uZ3IdBu27tIv7sDxHxFQ3ubM80ATA30hkkRc uFiA== X-Gm-Message-State: APjAAAVxmAaOn0E+g46C9p72niyqV9C7PX/7xJxnS5B8UXMLlKrGJAO2 M3vHm3xzPZWSTu901jtMgiqNLxBT X-Google-Smtp-Source: APXvYqzVTHUYgQqSsfdXTI8lXflfYi64pvjwREaLCT4bc9+K91fbPzrdC7I7w/ZlDX6hwnJt3958xA== X-Received: by 2002:a05:620a:132b:: with SMTP id p11mr864786qkj.190.1571709632972; Mon, 21 Oct 2019 19:00:32 -0700 (PDT) Received: from localhost.localdomain (189.26.180.57.dynamic.adsl.gvt.net.br. [189.26.180.57]) by smtp.gmail.com with ESMTPSA id t65sm8511120qkh.23.2019.10.21.19.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 19:00:32 -0700 (PDT) From: Marcos Paulo de Souza To: dsterba@suse.com, linux-btrfs@vger.kernel.org Cc: Marcos Paulo de Souza Subject: [PATCH 2/2] btrfs-progs: Makefile: Add -Wimplicit-fallthrough Date: Mon, 21 Oct 2019 23:02:28 -0300 Message-Id: <20191022020228.14117-3-marcos.souza.org@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191022020228.14117-1-marcos.souza.org@gmail.com> References: <20191022020228.14117-1-marcos.souza.org@gmail.com> MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Marcos Paulo de Souza Avoid introducing new cases of implicit fallthrough by having this flag always set. Signed-off-by: Marcos Paulo de Souza --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 21bf2717..2f04e880 100644 --- a/Makefile +++ b/Makefile @@ -86,6 +86,7 @@ CFLAGS = $(SUBST_CFLAGS) \ -D_XOPEN_SOURCE=700 \ -fno-strict-aliasing \ -fPIC \ + -Wimplicit-fallthrough \ -I$(TOPDIR) \ -I$(TOPDIR)/libbtrfsutil \ $(DISABLE_WARNING_FLAGS) \