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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 1CA02C432BE for ; Thu, 26 Aug 2021 07:29:00 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (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 6C4BA61053 for ; Thu, 26 Aug 2021 07:28:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6C4BA61053 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1mJ9oS-0005MC-V9; Thu, 26 Aug 2021 03:28:36 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mJ9oN-0005L2-57 for kernelnewbies@kernelnewbies.org; Thu, 26 Aug 2021 03:28:31 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 10FF55C0238; Thu, 26 Aug 2021 03:28:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 26 Aug 2021 03:28:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=Mi9JtAK6cpayzWBjprhHPebvcMv 4OYR6VhsMmtcsVqg=; b=rdAIr9PxpaZPzCvI+62M8Ovf7H2cyYvnnzOwO5H9MZv nUcmM6IsEyC/gKjVpcn8gyqbNg4dSWgAuJLtwtzp0ywl8amE35wtGNG9eQk1Lhoz BIgbmtsenTaJ3b6bLLqtB1oq11D3ny1rkr3qZRxKwfQn7gzePW1eA+PglbBSQfNj HqkpMW1Cizp5esBRNdxkOTwdBfwpzQ4YjtDPdfriCnX5x1/TdTLVqHdJbCAefLmS Px+rZvheifmIDrN2XQsRT4W2TRNyJ5VZpPTn6RmSlPN/dXX8FWxmhP+scmsbKxc5 gkbcLUrUr5gjboIwar38Vb4UOzO16zWT2mU9uQ7wU1w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Mi9JtA K6cpayzWBjprhHPebvcMv4OYR6VhsMmtcsVqg=; b=R6dI2Gjhh4ef/zxkY4lSV2 gSgdt2crLYi40bHsnuFBGQNGF1KIEjFd6ArKJOBTxe+UNt6AzepD6c36bIRK3zLi nJslt8m+5QKf5A91OLS2Tu5c/9sHzwfqH5ze6jndfKS4Ff9jUVa1wiJQhDcL1j9Y gwQTupGfJHgCo45OzvSPwGJMnANfmfijMdnbn9nZ7l487apktVFdiwf5pa4+UvTZ sKaYI99TorEzJSLeV00aIapZWR3sstWVzRCB45BOZAc0TOATacCS0st6qqa+BN4p HyKwwaafIn3c4x6vvpCzCim1I+lgKMuhVXIdxVuP4Il9t296MxbXDtCBmVFPEN/A == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddutddguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttd ertddttddvnecuhfhrohhmpefirhgvghcumffjuceoghhrvghgsehkrhhorghhrdgtohhm qeenucggtffrrghtthgvrhhnpeeuleeltdehkeeltefhleduuddvhfffuedvffduveeghe ekgeeiffevheegfeetgfenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorg hhrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Aug 2021 03:28:25 -0400 (EDT) Date: Thu, 26 Aug 2021 09:28:22 +0200 From: Greg KH To: daniel watson Subject: Re: surround complex macros in () Message-ID: References: <20210826052144.GA6234@challenge-bot.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210826052144.GA6234@challenge-bot.com> Cc: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Wed, Aug 25, 2021 at 10:21:44PM -0700, daniel watson wrote: > let me know if this is the right place to ask. > > i recently tried to make a commit adding parentheses around a macro > value. > > https://lore.kernel.org/linux-staging/20210817043038.GA9492@challenge-bot.com/ > > it was rejected as "This is not a real change that is needed." > > at first, i thought this meant that the code would be identical with and > without parentheses surrounding a complex macro's definition, when the > macro is just typecasting an expression. but then i came up with code > where having parens or not changes the meaning of the code. > > -------delete-me.c-------- > #define with ((int)a) > #define sans (int)a Note, this is NOT what your change was doing. To duplicate what your change wanted to do, try doing: #define with ((int)(10 * 20)) #define sans (int)(10 * 20) Now see if that is any different when you use it. thanks, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies