From patchwork Mon Mar 22 11:44:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12154611 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_50,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13C7BC433C1 for ; Mon, 22 Mar 2021 11:45:22 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ACE1A6198E for ; Mon, 22 Mar 2021 11:45:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACE1A6198E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 64785100EBB71; Mon, 22 Mar 2021 04:45:21 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=arnd@kernel.org; receiver= Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id BC9DC100EBB6C for ; Mon, 22 Mar 2021 04:45:19 -0700 (PDT) Received: by mail.kernel.org (Postfix) with ESMTPSA id 945126198D; Mon, 22 Mar 2021 11:45:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616413518; bh=liwkJr++xOmGVh9TPdenTt5K01dJM4oOTKgZCRao8aE=; h=From:To:Cc:Subject:Date:From; b=kbYalYvBeuLzPrVLtbx44T1v/8Z+M7nARJqzUOvEZS21sWRUC+xT2rbuhnUHSyV/h G7NJO4+Wut5U+8JT8eTSvosRajsGXhrJ/vlWqESbNQSIn8qVFXebo9AwV3LLlaE5J6 4/ebt+CABMqJJmpigDR20TD5DnkL1Nuvg9UqlUTV9ji3n4rC5fU7IXesHPBhvK2rN9 zl2IIWE5DEV6+pwzMsrRMm1Xg1yIjiAfvlVdnuo/uTZGRDq5dUUNUiGFVxlcICymrO Pys3xfKwfKBTuyy/6Ra8mqke1DWkKRVQqP3V0Bni0wlL6sOi/0izhgbF8kjWPdFebC USNdtP74Gsd0A== From: Arnd Bergmann To: Dan Williams , Vishal Verma , Dave Jiang Subject: [PATCH] dax: avoid -Wempty-body warnings Date: Mon, 22 Mar 2021 12:44:58 +0100 Message-Id: <20210322114514.3490752-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Message-ID-Hash: 6S5CWQGIRMIZ7IJ4NZEOFDM4BSKIPTC3 X-Message-ID-Hash: 6S5CWQGIRMIZ7IJ4NZEOFDM4BSKIPTC3 X-MailFrom: arnd@kernel.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: Arnd Bergmann , Andrew Morton , Joao Martins , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Zhen Lei , linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Arnd Bergmann gcc warns about an empty body in an else statement: drivers/dax/bus.c: In function 'do_id_store': drivers/dax/bus.c:94:48: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] 94 | /* nothing to remove */; | ^ drivers/dax/bus.c:99:43: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] 99 | /* dax_id already added */; | ^ In both of these cases, the 'else' exists only to have a place to add a comment, but that comment doesn't really explain that much either, so the easiest way to shut up that warning is to just remove the else. Signed-off-by: Arnd Bergmann --- drivers/dax/bus.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c index 452e85ae87a8..5aee26e1bbd6 100644 --- a/drivers/dax/bus.c +++ b/drivers/dax/bus.c @@ -90,13 +90,11 @@ static ssize_t do_id_store(struct device_driver *drv, const char *buf, list_add(&dax_id->list, &dax_drv->ids); } else rc = -ENOMEM; - } else - /* nothing to remove */; + } } else if (action == ID_REMOVE) { list_del(&dax_id->list); kfree(dax_id); - } else - /* dax_id already added */; + } mutex_unlock(&dax_bus_lock); if (rc < 0)