Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp257349rwl; Sat, 25 Mar 2023 01:36:01 -0700 (PDT) X-Google-Smtp-Source: AKy350YywaWx+M8+2061jRoKKdebHHbXnivvF4foqC1KiTVvEQ5J4qTclt81pvHWEmOKWsw/HKXh X-Received: by 2002:a17:906:f190:b0:931:a321:7640 with SMTP id gs16-20020a170906f19000b00931a3217640mr6777546ejb.74.1679733360955; Sat, 25 Mar 2023 01:36:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679733360; cv=none; d=google.com; s=arc-20160816; b=HUaf87zqPiewY9T9xJFjId0vgmw7BndhZkfTlgwsiRx67ZT7KNqM2Ksv8T119tjrL7 hEnURUH3gphZX1+vj3upmtLLfIlb7a1SlF9oC35MM2DhflnmUtdpXMGLFlOX0fD3FSgf Mdo9aIOMZXjgWQmdLLAdh4upT0/ZWD8Kvt0i4IlA2AWy1Px5DDukxNQcGucyT6nF6Gf/ uqdUo2vsFHYBFMMVU5aRhtZBf+fu/AUzoT2gdPY53eAMkrtdUVzNiY8wN8E83H0wRjdX WQkeEJIQ7HAlB94/SAV2iKzwrd/VTHrfuPo8jHvfFkCtCOxmct+hx0lFXH1QpdC2vgm3 mO3Q== 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=wLCOwvYpwNc9/QOEAckueFp3wL7KxyfLBgiwsXPu2Oy60Ve03EhMXRe77G1NHRmi6R VbOhDs0Or4aw8yGDDmpiQUCgzeSbuMt+4vTim/Hgef6Kudved0eoFGiYEOEfyvTxmoCp RTGiZTHEi3amLPwBFz+9dF6g5FbHMLSCeUFIckIv/MQG+QzGvJLYCSRTahiMV/B3+lof JUFeaodPny5o4bgMDARSVHhkfXBhGkoSPBGxzVtohbJJWt9y6Zq7NSZbZdPpVwD/61Tk 1jylzqy4OhhAsYh+QanXA5hGH2YU0Xt+oQsBtKlVSae/9G3luRUd1pgZb1h/TAutOCoS N1zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iF1D1M7z; 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 z21-20020a1709064e1500b008ca8e211350si22157695eju.9.2023.03.25.01.35.36; Sat, 25 Mar 2023 01:36:00 -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=iF1D1M7z; 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 S231954AbjCYIYm (ORCPT + 99 others); Sat, 25 Mar 2023 04:24:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231327AbjCYIYk (ORCPT ); Sat, 25 Mar 2023 04:24:40 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AADA15266 for ; Sat, 25 Mar 2023 01:24:38 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id x37so2405143pga.1 for ; Sat, 25 Mar 2023 01:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679732678; 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=iF1D1M7zPujubqAFaRoDsv44WF0fxsPh+P1yv7HPgWO600k7bQcVwJItb47E8USlzk pYfsPnJnn3d6sP7fi1fCK0iq6Yc9kQ3G4ypBs1DFbbEi5636oGrpjAlOqks8pTPvTYLE cwm3g/Z3XR8D4Feg/FzDiLb2vbZJuAs46S7RNgEyLopWutdgZN4lglRLg6GNkedsMfAR P7DYXcUlJTvoKnqlR28y3wH2OvWMHXidjielmmScmUrE8hFPEaH/myZ/2VH8/Aac3rHA wzWJBceIfhB7aMPBDqHz1kerasDENE59y8fbjamk6mxhe/41eeHSbjLcrDhSWRSVUtss AHqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679732678; 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=b+oRwfCrmgBpHRLf19rKbPGu0mlLEm5XP/2REdOwSuEO27q7HwxvpLLXP/6yDRovQB L6SooOtqKpUBY9LuMWhe+ST9PkOhZAlA5Ny4B7jLBHD1foTQgQJC9VH0+tSAwOrg9/Xo 52wWSy9EL5V2RY8ifJbKDEhrpo9+GRb255GDwFEYwUWn9UJ8mlYFXVWKiPtyEZYzpW5k fSxlGiHS9qpVb5PuofMSSgaHJAWsrGls3qv8f89SyFJkFcCFUYa1KMBbEPzhDNAPJG+Z lc8dKVedJefT28vFqyvAwQI7ikNN8104S6cTvzuiXz5orO7c8Z620ii/Ov0Fu1FsjxVA cD2g== X-Gm-Message-State: AAQBX9e67miNRL3xgEIMYGmXXkVpEkhwEBazSXLHhvIlnsP0747j26n5 fPDoy6FyLOD0yzGsTCcKkK8NR4kix+5YFwVG X-Received: by 2002:aa7:954a:0:b0:625:cb74:9e01 with SMTP id w10-20020aa7954a000000b00625cb749e01mr5601184pfq.25.1679732678056; Sat, 25 Mar 2023 01:24:38 -0700 (PDT) Received: from ubuntu.localdomain ([117.245.251.101]) by smtp.gmail.com with ESMTPSA id b5-20020aa78105000000b005938f5b7231sm15035875pfi.201.2023.03.25.01.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Mar 2023 01:24:37 -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 v3 1/3] staging: greybus: Inline gpio_chip_to_gb_gpio_controller() Date: Sat, 25 Mar 2023 01:23:33 -0700 Message-Id: <3fc5d84a99574ac4a76d26427ac544de375adeb4.1679732179.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