Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6023082rwl; Wed, 22 Mar 2023 05:40:38 -0700 (PDT) X-Google-Smtp-Source: AK7set8zkA8XCb2pWUfUe4khUBAtk2NMvlz1p8WD8vt36TmAE9Zb+4liw9eEthoBvCjLyyUi3s4/ X-Received: by 2002:a17:906:90cc:b0:930:18f5:d016 with SMTP id v12-20020a17090690cc00b0093018f5d016mr6863128ejw.15.1679488838520; Wed, 22 Mar 2023 05:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679488838; cv=none; d=google.com; s=arc-20160816; b=E/ylsUFUWVa/Qj5n2HdKcHMV4UuokJMKG495XqvQu8PMsoIASPaZa9NezMDirpbRhS wps9CtkGgtoHWEzrEJkRh0UwYx+7/he0lIpwV0WR5kDMV13yb9B8cY/1+80DWnzUOdzG Ch3uGcCSsx0XFi5Ytj/kJTVyyuxhb/imPaKNXPYhoHd2IhiaAeGzY6b6WmVNZa4Rmhp9 kFpAEoa+A9x2/K2qXZ0hXFbZL72V6NuRBNjdIeiolwKkYGRzJNxOfDWWFWrky/aOxQPS GA/qG1ualuFF8Oq/extvVXcTY0xFwHFyxTqfidYRtuEOhtspwwNiGguL7cgJbnmalSPS xM6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=NsXIYR1MPYOgLhgbK7yRoUKgF3p75hv84JR40qJjkL8=; b=k0+JW4sQJoDhfv+BLj6Fj8hH3kJwDYQ2XSMO0bUuh0Q+WEedIKsHnY+TyjWJi4vWvA PwE760mfCmmn/QpOz06yHdhqUGD9MVOWCd/esyDimJxBNN/ehQoYxUjCc74hsmg8lFGV LxY1bA8OFoMAHBhJbBtjT5JRCi1lKUtJK+v21bVWpuT4TTB4rTSWlK8QWfWaz90IU9vY Dmvs3I7nPvURjLwQhuwhVD9MbZPDtyz6/AZl/L5ph4BlfgadfY4r+slt8G9M2WXCXQxH KLIFa1+F0/GiLqTCbCWoKc+8eYf2itMuvyywTPaEJIk/bsKhR2o6MaIoeGy3k+J0TNgu qbXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=St9TR1J8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ieee.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q19-20020a170906b29300b0092bf128c4e5si15634405ejz.192.2023.03.22.05.40.14; Wed, 22 Mar 2023 05:40:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=St9TR1J8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ieee.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbjCVMj7 (ORCPT + 99 others); Wed, 22 Mar 2023 08:39:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229607AbjCVMj5 (ORCPT ); Wed, 22 Mar 2023 08:39:57 -0400 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 157274D603 for ; Wed, 22 Mar 2023 05:39:56 -0700 (PDT) Received: by mail-io1-xd30.google.com with SMTP id k17so8371598iob.1 for ; Wed, 22 Mar 2023 05:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; t=1679488795; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=NsXIYR1MPYOgLhgbK7yRoUKgF3p75hv84JR40qJjkL8=; b=St9TR1J8Ta0zC3p+s7hBN1vhvdI1VQ6ESMoIXwhlYPYOse7neLnQHcowzvaP3rJGiR F0AiZaLghrvT/GnDUv+Ck1f39sBWf79WQgtwsCyV8p8TUM8ZoNYhGj3CTvkVoHjUg2B9 j1VnJsTTauzuxOBRbc7Px7GUIpOxcDIZy3ZF0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679488795; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NsXIYR1MPYOgLhgbK7yRoUKgF3p75hv84JR40qJjkL8=; b=vwT5AGnamyxdqQ9cWR5f3eKEHdRB42BiZySl2aIzpEfIGnh06BpJtEj2sRDcxlEnzQ C6We94wobaCS8o1c8LCvgkcqgH7grmP6Qbl5UHQ8B2MF0zw9P3T1FhA8z1wvf4/YuFBI JfYgByWmyrOS7SqRv2k/e8BcoXsE/9fsgzdA/8iBpZmnaHBnourWr/a7YEXFGRIm2mUH VooWj7x408rfBIQd5SkUAsWtQAl81XcMPSq2XBC84ZlGsAzm8INY89c49kJLKGSEUL1/ RH8YVtbcBAR2imbfZlPWOgsvTwTRY9vN5+Nd6N7bcNuyljbW5v7J//8jpoquRL6tdCAI yxAg== X-Gm-Message-State: AO0yUKVnHsorS4OeijCguRCw40wYTVLQ8rVFkXs/2nGqQ3Pug/xBqd5V SJ+KPQaGY23SdNNOANSSZbfA6A== X-Received: by 2002:a6b:4406:0:b0:758:b4eb:cec9 with SMTP id r6-20020a6b4406000000b00758b4ebcec9mr773044ioa.2.1679488795164; Wed, 22 Mar 2023 05:39:55 -0700 (PDT) Received: from [172.22.22.4] ([98.61.227.136]) by smtp.googlemail.com with ESMTPSA id c22-20020a5ea916000000b0074c80aa17f0sm4470973iod.0.2023.03.22.05.39.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Mar 2023 05:39:54 -0700 (PDT) Message-ID: Date: Wed, 22 Mar 2023 07:39:53 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v2] staging: greybus: use inline function for macros Content-Language: en-US To: Julia Lawall Cc: Menna Mahmoud , gregkh@linuxfoundation.org, outreachy@lists.linux.dev, johan@kernel.org, elder@kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev References: <20230321183456.10385-1-eng.mennamahmoud.mm@gmail.com> <2e869677-2693-6419-ea25-f0cc2efcf3dd@ieee.org> <5efa6e6d-8573-31de-639a-d15b2e9deca0@ieee.org> <48674d8f-9753-780c-f37c-f83ea2855ae6@ieee.org> From: Alex Elder In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/22/23 5:00 AM, Julia Lawall wrote: > > Both seem to access the memory directly. Maybe the example is too simple, > and the compiler is more likely to optimize aggressively? Yes I think so. This is a little unrelated but the "inline" keyword isn't very useful because the compiler (at least when optimizing) already takes liberties of inlining code that it "knows" will be better done that way. Same thing here. This function is so trivial that it's almost certainly going to be inlined. So the benefit of a little helper function like this over a macro is that its types are specified explicitly, and there is no chance of macro arguments be duplicated or improperly used in the right hand side. If it's not inlined it also would normally generate stuff on the stack. The benefit of the macro is you can do things with the arguments because they're pass-by-name. But you can't expect there to be any efficiency benefit. -Alex