From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 B352BC2BA2B for ; Sun, 19 Apr 2020 07:43:33 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 3D6802145D for ; Sun, 19 Apr 2020 07:43:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="H6SGMFYJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D6802145D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9E2121669; Sun, 19 Apr 2020 09:42:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9E2121669 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1587282211; bh=SBnaJXMWlP5Jfz/aC8h2Gcq214H5zmesYB/TAZzBqdc=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=H6SGMFYJzMeHAMLYKCpb45RD+112z1Zvn0y6GKbClVyNtDDBS4UGc9JBTVgrP8KBL eq4ZuuSJAkH5ESw+oY5fjTPb2Yv63zDYijEcsMx6KuqmVe9EaFoSa+z4DTgyswLCUK lvTf4pHdqEhmLFwC/++C9TdJzUSrBspJU3kplkNw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5CCBAF802BD; Sun, 19 Apr 2020 09:38:33 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 71604F8014E; Sun, 19 Apr 2020 00:20:40 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BD170F80122 for ; Sun, 19 Apr 2020 00:20:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BD170F80122 Received: by mail-pg1-f195.google.com with SMTP id r4so3095155pgg.4 for ; Sat, 18 Apr 2020 15:20:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5lJaFjYcZIrKINzwKQy1R3xgWxtfsMwR6sB1R/eMtwU=; b=G/zPv4kEALqr3LRHjq+1CF4CnGa85IP57YhPb3gg8Njleo4BYoS/HdAexKCnzfpcJu /Mgure+yJcEBFmPKej/HYBBatzeNAZx9OsPlzMupCsEScuWGQc+VXP97hS3CcDQcXccD etYBCFc/SaK1rD9fvsor3rESr8l7KCWvPozkes/3pJqOVdkDH1sCIoolzjyTf2+3C0e0 oejykpXh08tH8T1vxHF3Kn3NNgVn/QBxuuJORyNgrMOWugetKfHXpe4ORKC67OSDr3Bl PRtrh8973HO5jboA+zV6dkXaL9t4C+L4giJEUDCXEiVoCqQt5x9NpIzsJWOYaV0G0sk/ oiXA== X-Gm-Message-State: AGi0PubNQhp4wEMgqFgdWQwunHJuhj5v84Y4ZnCAFkf66UhbUdlbbreQ K3SjWw/kOPTUAteW3gFYrxI= X-Google-Smtp-Source: APiQypKrKkW1CP9zvg0HpaxgHFnkJUL1mC4k4+CRal+TZ48iPbm1ertqTrjT7jN+bYBQFGm5GWkzYw== X-Received: by 2002:a63:554b:: with SMTP id f11mr3245678pgm.343.1587248435352; Sat, 18 Apr 2020 15:20:35 -0700 (PDT) Received: from [100.124.15.238] ([104.129.198.61]) by smtp.gmail.com with ESMTPSA id b189sm14519134pfb.163.2020.04.18.15.20.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Apr 2020 15:20:34 -0700 (PDT) Subject: Re: [RFC PATCH 1/9] kernel.h: add do_empty() macro To: Randy Dunlap , linux-kernel@vger.kernel.org References: <20200418184111.13401-1-rdunlap@infradead.org> <20200418184111.13401-2-rdunlap@infradead.org> From: Bart Van Assche Message-ID: Date: Sat, 18 Apr 2020 15:20:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200418184111.13401-2-rdunlap@infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sun, 19 Apr 2020 09:38:22 +0200 Cc: alsa-devel@alsa-project.org, Dmitry Torokhov , Zzy Wysm , "J. Bruce Fields" , target-devel@vger.kernel.org, Dave Jiang , linux-scsi@vger.kernel.org, linux-nvdimm@lists.01.org, Vishal Verma , linux-input@vger.kernel.org, Alexander Viro , Dan Williams , Andrew Morton , linux-nfs@vger.kernel.org, "Martin K. Petersen" , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Takashi Iwai , Chuck Lever , linux-fsdevel@vger.kernel.org, Johannes Berg , Linus Torvalds X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 4/18/20 11:41 AM, Randy Dunlap wrote: > --- linux-next-20200327.orig/include/linux/kernel.h > +++ linux-next-20200327/include/linux/kernel.h > @@ -40,6 +40,14 @@ > #define READ 0 > #define WRITE 1 > > +/* > + * When using -Wextra, an "if" statement followed by an empty block > + * (containing only a ';'), produces a warning from gcc: > + * warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] > + * Replace the empty body with do_empty() to silence this warning. > + */ > +#define do_empty() do { } while (0) > + > /** > * ARRAY_SIZE - get the number of elements in array @arr > * @arr: array to be sized I'm less than enthusiast about introducing a new macro to suppress "empty body" warnings. Anyone who encounters code in which this macro is used will have to look up the definition of this macro to learn what it does. Has it been considered to suppress empty body warnings by changing the empty bodies from ";" into "{}"? Thanks, Bart.