Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp722187rwl; Fri, 24 Mar 2023 00:40:47 -0700 (PDT) X-Google-Smtp-Source: AKy350Y5LbbeFkSrjdDqJ1Guvt85D5UQJharljMhxHvasTtigbUnFa7hIKquB277W+bLc6uToLro X-Received: by 2002:a17:902:f14a:b0:1a2:1a5b:cc89 with SMTP id d10-20020a170902f14a00b001a21a5bcc89mr515768plb.44.1679643647475; Fri, 24 Mar 2023 00:40:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679643647; cv=none; d=google.com; s=arc-20160816; b=c3v8iJ6HKK84fwRiiJgS7TOFkG5qDUsdBG/L+VgzCzet9qJB/4E5JOWVSNa1Li1QtO jD94cM2dbhC2bDFFhddCqoaQoh6W6CEr86WbRl+aE146vU4PQsHASPileFAC61C6wCJU F9Tl+e//pUI2dtI4XY25jpl+UzHj+cnYLNIg2aVX1hCfxpeBCXXACCi1snNvo05Sr3OJ SRUh9KbmyWK/u64wr4jEHOzbP7bmdSDrt9itThOTpHnyHilu0LdC6dQJyeKrLDhKwFwf mCEJrabCSSZ3mDj56XC93FIiowsFkdvuPSoaXWMme4bLsz43aX3uyoELIb62vIK1Iyog 1ZSg== 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=iFqGuLOjRab6Iw0/SrS988UhB5baV+MAIu0DYUhVDv8=; b=DG8FqBSPQVhL2peo2HqewOJboNe/DmLD0D5ni97lBYYlLYcYnjioF1bZPfefyhpOw/ kMZ5E3IKHxo+EOdMZptF/EuS9diilDlG4/hbJUEqR5cmptpwskv0JpKt7XtNOCP1aYZk Ba4w/XO/DInrFLE7JzyD/Nj5X391sWXyvY2nyNU8tGUlT4bdpYHMwKRG0uFQqZ1dvLAF B5MgZxlyX3K8nk23B/mbkw3PNzX4qUUYuos++UofIkofzIgJquSrfS210fqJVFsFpQCr QwBWKnqnLrXtVnXuRX2YaqncyxOfsJzyqTiy2KDuFeMBvHPFPAbmkVoGvEMQ8v1+n0pJ fKJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TbYYunfA; 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 k11-20020a170902760b00b001a20c983d1dsi2423195pll.618.2023.03.24.00.40.34; Fri, 24 Mar 2023 00:40:47 -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=TbYYunfA; 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 S231561AbjCXHdU (ORCPT + 99 others); Fri, 24 Mar 2023 03:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230071AbjCXHdT (ORCPT ); Fri, 24 Mar 2023 03:33:19 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DF3C40C0 for ; Fri, 24 Mar 2023 00:33:18 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id kq3so1064414plb.13 for ; Fri, 24 Mar 2023 00:33:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679643198; 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=iFqGuLOjRab6Iw0/SrS988UhB5baV+MAIu0DYUhVDv8=; b=TbYYunfAKu2D1sw2lxqSPDFgQq4QxB+C6KjrzoaYoQYJvFSh0LNCsqjKiCCBwW8BrP rk4reQW4vq5tKm4rrPB80RQvjxvUG/AaHRLKhgsHpM7L1cV/MZw/iroBWlF4F6VYXt9t 6a7u+Tk3RzBMl3L82gu3xu/B9ieFWV5IwnkU7rnS3FEalfbAiVwxZMP0k1sT6cWn+7cm cy9NzMtALZfOnXCmtCfiE+qxHRMfF0DsmmOG8YrZcLrkS5tzTZcmXzd4LWfmnwxpzmsa BMBl0cZkLNcPFz12Cc03ppXMt2WRhC1bLEW4pGj/FMc7OwKYL4cnTqvT3ZA8ZHNr52Fm MxHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679643198; 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=iFqGuLOjRab6Iw0/SrS988UhB5baV+MAIu0DYUhVDv8=; b=HDW/C8jBk/+7LvKiTBPtq3xcnPWGAfYmbzgrnDCdV3HLjSQHms0OTjgOfK8QgJ+dzM MxyNAV/qRhk8Rt+JMR7D59oImIKDFjPIl7kqi3+8GN3GadTQpbI53ozU/rnQlKHfQOKn 5OfAdc/zXPV7KH5P3fUSqClX2/VRvIl6PCHZaRLlKm941cERBIvPLq8ynU0pqrWBlG0+ ReLCAZIQDWRxws13MnL9ijm+uLJLnWwB1rM/cqMjd9rZuIyA34IJJbNzgX7mjtMiwMLg heJ6JBYGaCjwaaGhoX1C+Yt+Z48OTiMX9Q7Nb3Hu6ecHKV/UTjz12U64Z5tOEmap6/p2 a7RQ== X-Gm-Message-State: AAQBX9ekSoqJW6hk9RqOjanOTaImmtEvJIDo0jo+SX/nwAQTT049eyOJ /miSL7YKPX6Vl5Dj1Swe9L6mHv8ofjbVYQ== X-Received: by 2002:a17:902:e84d:b0:1a1:b528:9bea with SMTP id t13-20020a170902e84d00b001a1b5289beamr2028314plg.50.1679643197759; Fri, 24 Mar 2023 00:33:17 -0700 (PDT) Received: from ubuntu.localdomain ([59.89.175.90]) by smtp.gmail.com with ESMTPSA id v12-20020a1709029a0c00b0019a75ea08e5sm13511604plp.33.2023.03.24.00.33.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 00:33:17 -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 v2 2/3] Staging: greybus: Use inline function for gb_audio_manager_module Date: Fri, 24 Mar 2023 00:30:00 -0700 Message-Id: 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 '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 --- v2: Change patch subject, noted by Alison Schofield 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