Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7296734rwl; Thu, 23 Mar 2023 02:11:49 -0700 (PDT) Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LIkMDCo6 X-Google-Smtp-Source: AK7set+dxQjITseivymqk6N4h6QiuHnWmICbU15rq92Xl0IlpOeljd8JF63JG9D0j3qj3tMHKuI0 X-Received: by 2002:a17:90b:3906:b0:23d:3383:1d68 with SMTP id ob6-20020a17090b390600b0023d33831d68mr7146458pjb.35.1679562708965; Thu, 23 Mar 2023 02:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679562708; cv=none; d=google.com; s=arc-20160816; b=eYQS2SDQpb/CPkf5l4y14FJUCbwLYGKrvZm1ewoq62ByyfKXvhoBKsTPv03pvkXQyA GEnaUj61Kpj7hI20cabFiTZEahrF7Oz/Ss58nVnetuyYP6eIqYpphzHeIfSFcx4UOTKy fHmQNP/UIbz/uZYjAr7CWNcXhaa4zkMFY5dvxcLB6P/dchCfJv7UF4HDACDDqejCTRa8 HokdFADHSl26Me6MH1IcQCJ1ENjIcwmYgPeGAuwTrwnZ+IKhtj/8d8+0j0GM0dEl8nx2 C5twVUoz9cKXxRhCNHsnHM3rg+ngM/+YlaMTYANShSBCI7fDC/6AdST8VvaUlHhvuJm1 3ieA== 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=HkAGxiMm0D6sZZHk+W+42sbwTh2uKjw/ysosEWY5e6A=; b=0NVu5CyFQa8/mgSFfuwqbLJhH7IzGlaIsJTVK26j34YpDVAj88XgsUCfpE0tKI6e+z 3icFK4t0CBthKcW6lSPh6k2Wqx/Iq+4Bd6+eKaGk/3oAI8CK++bwDxWibfPnXqKZgoKw OMZcJ4ton3cX59dh6yx6QNdj0KN4JEcw9JkbA+8SVjfJ/bPOlWhSrruGhy68pK9mCRVd MqG1pBhldbZe4JcLV55G8qIgZh/IEqINWmPwwQsGS4WHj2gC+9u84rRX+HQG6M+JVIH1 68f4NjU6ufgte6KgZYFlgaljqOfkDPRoz7VmwBCpp43/ncneZ24fq9Qm7jJJIvKnjOo3 8bBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LIkMDCo6; 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 bf5-20020a17090b0b0500b00233e9243c88si1226619pjb.187.2023.03.23.02.11.37; Thu, 23 Mar 2023 02:11:48 -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=LIkMDCo6; 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 S231629AbjCWJFD (ORCPT + 99 others); Thu, 23 Mar 2023 05:05:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231603AbjCWJEh (ORCPT ); Thu, 23 Mar 2023 05:04:37 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8BBC1E1FF for ; Thu, 23 Mar 2023 02:04:30 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id kq3so9299071plb.13 for ; Thu, 23 Mar 2023 02:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679562269; 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=HkAGxiMm0D6sZZHk+W+42sbwTh2uKjw/ysosEWY5e6A=; b=LIkMDCo6uE7KtCBkAYpv7U6sC6jQgySdx8sLRUp+8pMXXhPbM43mYGNBF63R+WRXoU ukIJ1GGYQ4ykj/OhCzf75lefRjFVnxS5gcTa6UaiyxSZlhgjA31yxQWEbDj/r3BY9/g+ S6xy4Pgq97Q94R3Fsk15pA6dDpcbmKcg6g+oj/N+0Mle22mvizygKS2m6D4JoPbb3bmf bwZJVGXUk4tBt7cPTHn1u202TOgXst67Eg8w3X2DTXrjM3MRjCQzZhPDWUi0ybGKC0OG /rnV6SubfPMNzVf87Cw9WwnzOkVvP3CMk//Pvjy9oa5YVrx8p4WGSPT8Zsc5f3lNNeIr Dulg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679562269; 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=HkAGxiMm0D6sZZHk+W+42sbwTh2uKjw/ysosEWY5e6A=; b=pZ4H0zHgDCq5osBDbHkPpW+tnAnbY/eOfEPEIesn4F5JhpfYfmAVxSGkLTM8t+fPYU aTgC4GYUk5iS9S+rSGjb0BWavgATJBtA5JSPJ/jRYQIjSr6zB5af4KG+YAEbN8IVvZ6W NKXfat6mK89pFFi4k/E4EsWwt8igSzBvPcWQy7GNqXXga2kRi1tDVD71M5MHZG8uoYMm 2JxH/Nap1efvNpUk2vyLjTip+oeLdslb/plPtjg+MuSqcCtDHfbRoQC2OKBlbIgzYsiw hzRrml+V+qt9m/vPNcIrda7Rx6dT0NYGdWbFElP5KLcSN2WbMzF1pgpZZN7yUzr6WVFi RGPA== X-Gm-Message-State: AO0yUKVgYfmO41RtBVjQaloVGfT0RXKaZVgbapC0F3tExZqjIT/uGN0C IXhGG+sU9AqJGzrRXHKnOZQ+R9CvG8zxhQ== X-Received: by 2002:a17:902:fa43:b0:1a1:a5df:764 with SMTP id lb3-20020a170902fa4300b001a1a5df0764mr5230531plb.7.1679562269354; Thu, 23 Mar 2023 02:04:29 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 02:04:28 -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 2/3] Staging: greybus: Convert macro struct gb_audio_manager_module to an inline function Date: Thu, 23 Mar 2023 02:03:40 -0700 Message-Id: <2a1752d909a33f2a8e93bd60043aaa5a659c98e4.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 'struct gb_audio_manager_module' 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/audio_manager_module.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c index 81b4ba607a0e..5f9dcbdbc191 100644 --- a/drivers/staging/greybus/audio_manager_module.c +++ b/drivers/staging/greybus/audio_manager_module.c @@ -12,8 +12,11 @@ #define to_gb_audio_module_attr(x) \ container_of(x, struct gb_audio_manager_module_attribute, attr) -#define to_gb_audio_module(x) \ - container_of(x, struct gb_audio_manager_module, kobj) + +static inline struct gb_audio_manager_module *to_gb_audio_module(struct kobject *kobj) +{ + return container_of(kobj, struct gb_audio_manager_module, kobj); +} struct gb_audio_manager_module_attribute { struct attribute attr; -- 2.25.1