Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7296185rwl; Thu, 23 Mar 2023 02:11:15 -0700 (PDT) X-Google-Smtp-Source: AK7set9t4a5yCT300NDVgSdBl+hyRlADx6ue35W6T5PiO7V3m9XG9AaY4Xi0LsXakkcTlthnIog/ X-Received: by 2002:aa7:9890:0:b0:625:14cb:8b7c with SMTP id r16-20020aa79890000000b0062514cb8b7cmr5746053pfl.0.1679562675384; Thu, 23 Mar 2023 02:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679562675; cv=none; d=google.com; s=arc-20160816; b=viDsgjOvdOnwwjqO+rfLLubYn4RGxpwOxAhRAteii8Ht68itYWQvmJGX+x+4QBMSk9 fYzhFPhPcENH2lOrcel2/5AbDd9OfR3Bl8ppfkAz+fm9nkjRBDxWAXDxvXdxtzHErADQ 0hNOaGz3yt+7HhDURwhUXiCGbruGxMzAMijM06LNG3Z+IJ5M5D/4a6z7bc2tmr5MlDXN NFhqvkU1db+lbuVw//Pfrrv0gmx+b2OEzlMvHpeYSrNj6c928r2N7vQkUyx2vGS7OEN8 K/C0sMk/FjXl9Q4Z88qI0zDwreOw0UnTRfcdc53UJO2WFI9Vtz0XgWVfOUrF8uGrGIwk qvEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OjcZplfqBfGxkesm/SQ2YHNMoUVOYWANADhv4EwbVKw=; b=UVNvCAtnPLXa4Gn4mEGjmLNfRjd5pWggEVF9PLnLQ6eLUrTm1+2b69f9CvVwnpKFvC BZGTaYtGP8QKY7GYXHS8eTf+PeTxoBgmHy02mByN+NlG6lFjoXK56Dxb67WWssjzc8RS jcWYYuu/L/oH8Xp3NuNJbfS6HZZXUm8k+JDeJjpbcEEi13Wy5ytxczdhvmw8XZSJvNBQ GbwKHwjWEvGKUCesRBlwRllCzoq66J642wUC4Nc/3IfrQglwFPIqVeWyOAUWpf7aBcw3 VJ/WqA/gSzHnOFbJovp9hLFNJniEyFTyWUO4zed/GmE4HqxojH1JXhcNSzAc9bTn1myp qHEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hoFy1YlM; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g6-20020a632006000000b0050be58cbaf7si17180808pgg.733.2023.03.23.02.11.03; Thu, 23 Mar 2023 02:11:15 -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=@gmail.com header.s=20210112 header.b=hoFy1YlM; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231562AbjCWJEY (ORCPT + 99 others); Thu, 23 Mar 2023 05:04:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231550AbjCWJEO (ORCPT ); Thu, 23 Mar 2023 05:04:14 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E187E1DB85 for ; Thu, 23 Mar 2023 02:04:08 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id om3-20020a17090b3a8300b0023efab0e3bfso1282555pjb.3 for ; Thu, 23 Mar 2023 02:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679562247; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OjcZplfqBfGxkesm/SQ2YHNMoUVOYWANADhv4EwbVKw=; b=hoFy1YlM+Ou4lh0YKLuMnMSIdbLbE14MqBS1SC7KjUNh2kF/qIvdI94Q/6Pf6fQYgD SLOV7FX4N/holaDTDjRHZYO5HjilL5W6VQ/vdCtKhXubLcAQBRhJvxnItxYn4W3Eoqkn qGZdnJtgtBoUwyYEJUkd/ZhRZ16fPJiij1SSdyQrqqoAWQ5/R8L774dQwWWPYDjV444G 8sUCpfgwE2HbjBA/hwPluQ53d9VYOftWc/jM7PE8763T7HywEa+7U8M+nzXd2hsKbyWq eYeA5Z65UH7hAE1wRhvXz2D9i6gGDFXwp+uXSIZ3X4415fvat6tbxl4r5ewZEaIsLvZW ga5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679562247; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OjcZplfqBfGxkesm/SQ2YHNMoUVOYWANADhv4EwbVKw=; b=1w4xv7RNK99vBlFOfaQJgEA50GzB6Mv164f83tX9g5vjX7TjZbARwxyTIbCIq7VTIt MIjYk28Km55oVuj3ExHFmF2ifst+2GmHT+v/vtD/FaWaviUq0FOpqPY7t/PMkYHl5bwN MNvM0UYz4T5RyMzwYl3PhLEx8IV0veV9/zj2i2g1muUHF9u3zudAQiQdceZkD4OiZ2O2 n+qI2bbbQcHnceK4VwMaEAkKcFBd3eA1/4uDaWDvGf5jzGV7cbpDSyW8uDInvhyLbdzG +9yf8jU5r9nfZD/aUaxDFDW89036aDUz0SCXvSgqolcW9r0st6P4hwuZvpImJ2ThT8vV VbMw== X-Gm-Message-State: AO0yUKUCXwsrTCaKk01I8DRHpy9MnR7CfrNeUfXIZ0+0TeHDT/82BthA eKBQYld8o14Tc1MlN9qaZi0= X-Received: by 2002:a17:903:247:b0:19a:9880:175f with SMTP id j7-20020a170903024700b0019a9880175fmr6518482plh.51.1679562247398; Thu, 23 Mar 2023 02:04:07 -0700 (PDT) Received: from ubuntu.localdomain ([117.207.139.205]) by smtp.gmail.com with ESMTPSA id q8-20020a656848000000b005034a57b963sm11277116pgt.58.2023.03.23.02.04.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 02:04:06 -0700 (PDT) From: Sumitra Sharma To: outreachy@lists.linux.dev Cc: johan@kernel.org, elder@kernel.org, gregkh@linuxfoundation.org, greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Sumitra Sharma Subject: [PATCH 1/3] Staging: greybus: Convert macro gpio_chip_to_gb_gpio_controller to an inline function Date: Thu, 23 Mar 2023 02:03:34 -0700 Message-Id: <92e39b9957a1863d13fc5ce9e346e99c68550fa3.1679558269.git.sumitraartsy@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Convert 'gpio_chip_to_gb_gpio_controller' from a macro to a static inline function, to make the relevant types apparent in the definition and to benefit from the type checking performed by the compiler at call sites. Signed-off-by: Sumitra Sharma --- drivers/staging/greybus/gpio.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c index d729b922a750..2a115a8fc263 100644 --- a/drivers/staging/greybus/gpio.c +++ b/drivers/staging/greybus/gpio.c @@ -41,8 +41,11 @@ struct gb_gpio_controller { struct irq_chip irqc; struct mutex irq_lock; }; -#define gpio_chip_to_gb_gpio_controller(chip) \ - container_of(chip, struct gb_gpio_controller, chip) + +static inline struct gb_gpio_controller *gpio_chip_to_gb_gpio_controller(struct gpio_chip *chip) +{ + return container_of(chip, struct gb_gpio_controller, chip); +} static struct gpio_chip *irq_data_to_gpio_chip(struct irq_data *d) { -- 2.25.1