Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1458566lqp; Mon, 15 Apr 2024 07:12:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXfnk2luWINcdLomWf9TYEeZp+aq5rnAfxV+vn0hUUQx6yYP+IwYGJ/Oc6R90v74s5nIm0py5ZSaFgkxQ6TobahrUkzaxPqWJfz27qf9g== X-Google-Smtp-Source: AGHT+IFpA7i/CyClhldoms0ehHd8C+bu+rpxhgxhl7lIBe2p2InA6ps3cpDRGYuVCqQ9lttJTKgb X-Received: by 2002:a17:906:c9c2:b0:a52:3874:6208 with SMTP id hk2-20020a170906c9c200b00a5238746208mr4557711ejb.61.1713190355015; Mon, 15 Apr 2024 07:12:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713190355; cv=pass; d=google.com; s=arc-20160816; b=ptCd+JJPMfMbePPkV2hJ9L6ZL+9QIGo/asbuwjfD/p1L94ZQLwh23ksERFxOgu3Yyn 2nZ7n5NhPYV7Gq+qconN9E6dAvfj64kWCEn1bEmb5KAkKJaclWKZLtbsT/HTbBEufa9T 60U2R9bbBTgsduKnzRBpnnDn4SISQrNZiyLXs45ZusDw7hs7kck1Me02Jb4hC/TQ1ZNE RY1eB7GzbX6hYQUmL35AknGQ3hIcdJfK6vKYzS0HkIS7dbxyRJMShgRNPoCK2JjsED3T zfn9Jf58SQrbsZuViRTXxNRPiDllUnsel/nH72w8wFjI1BFfjgc/+vQ2+zZIuVmZEshN APZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=YR+qKcWAqCaplzcT2MxW1L6RiBbL+LHsEU4FUpE8GN4=; fh=XBe6JxRZ1Z7txXJKS1gWIu/dH1vRNhszT6ly+xmmcWs=; b=vWMetTNqxCcdJTziLpPpzy6/7TkDzEcWlKzpFgj9WnuQ3lBvotWTQT8gZn1ccUYp9y yEAxYw4jaukJPiLS8PRgzwHfXFbBOr8CPhRNE3gWjmhSa1qhmsvjEzkLudVNpMtcVkmY nEEjKKGJ3U8SnSprI68rJfyhNhI7ZJojvBnoPejcX9opy6dviUBb+jsh8ErIwuG9VQVF W9VHIjT6eSlazE4/T8iGfs+QaGyFXQ330v4XcjSBFNySbfvE9JU1Sbj3uVZlC5WczFeh gG85QP5SsVbJ/VvA9gnWax+80CgH/n/XcL7P4g7dXjDM1Hn+WhLjNftQXHcAPVVYOH17 rN/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iqpP07jo; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-145325-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145325-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ht17-20020a170907609100b00a525910c974si1903069ejc.643.2024.04.15.07.12.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 07:12:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145325-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iqpP07jo; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-145325-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145325-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0C1961F228D4 for ; Mon, 15 Apr 2024 14:11:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03F0874E3F; Mon, 15 Apr 2024 14:11:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="iqpP07jo" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6C7074439 for ; Mon, 15 Apr 2024 14:11:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713190281; cv=none; b=rWj79IOJ7cJWsUpGNxQVW3t5x+dvfARmNPW19YORm7j5rMZBkx2hKTuAyIs51R5JoD9uDVYeuTsGH3cNn7lVwvOV/L74/20RsaWaxyda9PtyWPQeUba3GubkRVbyCMW8xZ9chtmNrpuN4+5NzA4eINNCKTro04FRuJqDUiRIytc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713190281; c=relaxed/simple; bh=4UaU9zFwhxCtMXiEsZ/tAndAnGkb0E4UlcAo8P3HWE0=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=ejlwU+u05/VK9Iskp5zf0k8tm8FjUnxSUKv8KcNar/EXZChnr2KhX8+HpJeitiC3sF6EjLebVOPSYt7p7JGdzZXD4Wi30gdk2BmaVfu2UiU3LR535Mz8AL4M6thdCklXW3VVdsiXzK+mXBF7kk8SwpE0iDBMCpeJJiKkGHi++ek= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=iqpP07jo; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713190277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YR+qKcWAqCaplzcT2MxW1L6RiBbL+LHsEU4FUpE8GN4=; b=iqpP07joffvhG7iUEZqKzyT6VhCz12OBA3ieQRT/YhMGTOZBhYHhtH8hvsyv9fJBE2Nt+Y 4jArpwr14rYcz0s2qPyfFfxTnBiYYDTT2lxQPlE88IsxZx153Al6LLbLZ4XlAM/zf37Hbd ld9ps3+YgC3FijCOht3NUqMAhNwFHKM= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-647-GHnMOtpdMnqInicSMQaYDA-1; Mon, 15 Apr 2024 10:11:16 -0400 X-MC-Unique: GHnMOtpdMnqInicSMQaYDA-1 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-56c3dc8d331so2541903a12.2 for ; Mon, 15 Apr 2024 07:11:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713190275; x=1713795075; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YR+qKcWAqCaplzcT2MxW1L6RiBbL+LHsEU4FUpE8GN4=; b=tvgd4Pea4PRzpUDTYPCrzNDkC+yh+wOokAIBddW9BxPrYBf/Rddm/RPebXTHgehCNt cARyveEXM964WLXYk96uqGqQtR9lGPc1TcWY8o/DCIyNavScxB8EkWu4Ox8G23vZzIVQ NxlRuHivdyPPr0uWDQxBDZLt3N7nExzqEulgIOOgdh+T2dVMlO90QrJI1TOncvQ80E/8 uDJrMWESI/tGz2bu/ZrRK4at3+noaQk4dBbG5qOzzpVokPZoGwifesRMjYaeucilh6m3 bHvxEAywN5x9DWIOZPBSU/nDKu5EaOTRBlzQoW00t9KhTOLkej4hXMIXUn+IuUvqqNCz G5mg== X-Forwarded-Encrypted: i=1; AJvYcCVzIhzaOF2gkiGo35LdXqtMJ96/3/brc8o4W5LkJPcuKa52uwwZm0j30tix9XFJwA4/OAHWJNJCCWvpr1xadzJz8yopYEGQgzUJlj4s X-Gm-Message-State: AOJu0Yw7R3qVfl9WQTVVbtbxoAPxtLpkw+NXnb6D4QvL4WbAiSmDs6/L 7Hc9HFSd1N5JbmvMrSw5W+masLYXx56ZZHDybXZ/XXlKaoFsw1fPtni7RAAvluCbM+QzpKRn46D Dniw6XDKjMkFx+wWAE77NvY4xXF0Sn/UNTPbbErmq0lA/Z2ikvU7IX6QLB8kNaAIgKlssUWee X-Received: by 2002:a50:cdd3:0:b0:570:f6f:fdd3 with SMTP id h19-20020a50cdd3000000b005700f6ffdd3mr3973869edj.18.1713190274835; Mon, 15 Apr 2024 07:11:14 -0700 (PDT) X-Received: by 2002:a50:cdd3:0:b0:570:f6f:fdd3 with SMTP id h19-20020a50cdd3000000b005700f6ffdd3mr3973852edj.18.1713190274483; Mon, 15 Apr 2024 07:11:14 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id a15-20020a50ff0f000000b0056fc72bb490sm4832310edu.61.2024.04.15.07.11.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Apr 2024 07:11:14 -0700 (PDT) Message-ID: Date: Mon, 15 Apr 2024 16:11:13 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] platform/x86: think-lmi: Convert container_of() macros to static inline To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Mark Pearson , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240412130903.2836-1-ilpo.jarvinen@linux.intel.com> Content-Language: en-US, nl From: Hans de Goede In-Reply-To: <20240412130903.2836-1-ilpo.jarvinen@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi, On 4/12/24 3:09 PM, Ilpo Järvinen wrote: > The macros to_tlmi_pwd_setting() and to_tlmi_attr_setting() are fragile > because they expect the variable name to be 'kobj', otherwise the build > will fail because container_of()'s 3rd parameter (member) is taken from > the parameter given to the macro. > > While at it, move them into a more logical place. > > Signed-off-by: Ilpo Järvinen Thank you for your patch, I've applied this patch to my review-hans branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while. Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window. Regards, Hans > --- > drivers/platform/x86/think-lmi.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c > index 9345316b45db..0f2264bb7577 100644 > --- a/drivers/platform/x86/think-lmi.c > +++ b/drivers/platform/x86/think-lmi.c > @@ -175,9 +175,6 @@ MODULE_PARM_DESC(debug_support, "Enable debug command support"); > #define TLMI_SMP_PWD BIT(6) /* System Management */ > #define TLMI_CERT BIT(7) /* Certificate Based */ > > -#define to_tlmi_pwd_setting(kobj) container_of(kobj, struct tlmi_pwd_setting, kobj) > -#define to_tlmi_attr_setting(kobj) container_of(kobj, struct tlmi_attr_setting, kobj) > - > static const struct tlmi_err_codes tlmi_errs[] = { > {"Success", 0}, > {"Not Supported", -EOPNOTSUPP}, > @@ -198,6 +195,16 @@ static struct think_lmi tlmi_priv; > static const struct class *fw_attr_class; > static DEFINE_MUTEX(tlmi_mutex); > > +static inline struct tlmi_pwd_setting *to_tlmi_pwd_setting(struct kobject *kobj) > +{ > + return container_of(kobj, struct tlmi_pwd_setting, kobj); > +} > + > +static inline struct tlmi_attr_setting *to_tlmi_attr_setting(struct kobject *kobj) > +{ > + return container_of(kobj, struct tlmi_attr_setting, kobj); > +} > + > /* Convert BIOS WMI error string to suitable error code */ > static int tlmi_errstr_to_err(const char *errstr) > {