Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9380366rwl; Wed, 11 Jan 2023 05:08:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXtYxZ9yUaUbml6rzX125klozCRRxZlF5qny2oOr9/jsHm6JZjVOJV4Sl5g0uTmYFnuAF6Br X-Received: by 2002:a17:902:e212:b0:193:2303:c9d7 with SMTP id u18-20020a170902e21200b001932303c9d7mr2275117plb.5.1673442532329; Wed, 11 Jan 2023 05:08:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673442532; cv=none; d=google.com; s=arc-20160816; b=urySxC39sDjWKwhsm/gk4YLTPqhxaHI5kRns+GSixQ2QI3P4LCkP54jcoyb+RkecSk TcGvt87pSbDncKjOhzk8cRxNIdXCTqY+n/8H4u2ChjnLswa1d3iK78JBTLeO0J5iPXjo Fs3VXBdH5lBQHQd4KqszfHsP7Ev+cYicUILyaPeyIib5a+1SUt/OZRZrgwlORplrMGu1 jK5MznFDxDHLCmN+vun/DzjREbTmiPGdPwhqntsoZek8/K0f25clEC7pr523jsX7jbi9 cDTg1+yp4jXDhYHE2h/8qap3Keo2TTmO7Dg+73DyFRgiKqn3DNiPN8Ku6fQ50mv4harE pWaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=TVfpR4qnnt4VaJlKgg5uKC+n6RBtytfGonDbBkqbvhU=; b=Wehtlo3QDD3FyAEFcJK+4WBiqJWWEnEGwKNWR/El5HsVWGEl1lXLxYTLemiu0vcRx6 IhPa5dUv9WJB9QsAhS7OcGVQBsPaui/bVyAtkeqaR1XPgKLrTC6OigRh8sJT+y2hVDKx Jo4vCTc9LbUkloARB+ZVu5LjvVIlmdion9WZ3c4/CnCXI1gQ+GUl39FqkN8//IGyiTKF 8GJuIUJnWKTaFf2hneHb7B+Tf2LcI8HH6Cn3E7wXzOv/g5imYr0q5z4SAT5Wp6v2D4DV aQmnR+JekHv3EXT0pi+x9IcWVHNFjnQ3ZR5OK/NFfYNfX5lCbbqeAb15BdaiaLNs7EVN Tx+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=l8JdqoiR; 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 r3-20020a170902be0300b001899e4b37d2si13388198pls.74.2023.01.11.05.08.45; Wed, 11 Jan 2023 05:08:52 -0800 (PST) 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=l8JdqoiR; 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 S230007AbjAKMEn (ORCPT + 53 others); Wed, 11 Jan 2023 07:04:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233317AbjAKMEM (ORCPT ); Wed, 11 Jan 2023 07:04:12 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 316DBBF5A; Wed, 11 Jan 2023 04:02:04 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id z8-20020a05600c220800b003d33b0bda11so2488204wml.0; Wed, 11 Jan 2023 04:02:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=TVfpR4qnnt4VaJlKgg5uKC+n6RBtytfGonDbBkqbvhU=; b=l8JdqoiRlZCHy0/sUK/ggzfLKv6dZ0hkwSA6WypM6VOYQO3LtTJhIS3yyuzQ7m3Mu/ O2LvkATVrursa5rHARQ2UklGPDi4UXjzN9nufnP5x/TaFB8EnL7j4/Z06n7ZxeXAe79j Op60SZrTCplGrfi6kIgOSzAD0iYem8eT8fxiMMQ8RUgHGZdAGPYl6or+XUEwDTupr0tU MeCVH2Smrj4ktUzDWUp7RfasWibCO2tkBtfoSDbU3PsWGSjuhQFmjr/ahKga5DrrXC6H ibP8Qpl8rTeDOPe5cdKbhZeYRV/uY9Baps18lOz7h7R+xe4+YbrDyyjFvip8MvwRo3W8 6xHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TVfpR4qnnt4VaJlKgg5uKC+n6RBtytfGonDbBkqbvhU=; b=jyMxbFKnIgJrVcSskrYz1PSoyiCb2XXmAAgXY+Af7eLb12vrDtvUTafc30pnjEyUJp eSXFtCch83Yb56g5ZFQDMhKS1C3GPiQfmnVanoONSeDhi4zpj6APWHTgo+rUnm2/YJ2q nfGDDH/VWL2z9Q1u++xgvtCd5RMh+zEJDCPnjd5T5BCvXo4GO75vkWQI32rsmQp74ELF 19PZA+S6BcHHz6zmRKC4kQUECxlrv4kN0rnxlSc0Z+jXNKYNwsMiXkHjr7jH8Jh4Cwfs IvrPN4rmMnIoFcWB0UkXFQkpSEjVb7FWRNBOZYymqdASPn9vLvQjFHr+K1dl3LCo9Nol rxhQ== X-Gm-Message-State: AFqh2kqJZMDMeplqQteLsseE1EHiqs82jd+mBkg6yHTXerUTTCTm7y+k AqNk0ml3EOvunfAx035mzT4= X-Received: by 2002:a05:600c:5014:b0:3d3:446a:b46a with SMTP id n20-20020a05600c501400b003d3446ab46amr55108709wmr.38.1673438522610; Wed, 11 Jan 2023 04:02:02 -0800 (PST) Received: from [192.168.2.202] (pd9ea33ef.dip0.t-ipconnect.de. [217.234.51.239]) by smtp.gmail.com with ESMTPSA id w12-20020a05600c474c00b003d1e1f421bfsm1530104wmo.10.2023.01.11.04.02.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Jan 2023 04:02:02 -0800 (PST) Message-ID: Date: Wed, 11 Jan 2023 13:02:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v2 03/16] platform/surface: aggregator: move to_ssam_device() to use container_of_const() Content-Language: en-US To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: platform-driver-x86@vger.kernel.org References: <20230111113018.459199-1-gregkh@linuxfoundation.org> <20230111113018.459199-4-gregkh@linuxfoundation.org> From: Maximilian Luz In-Reply-To: <20230111113018.459199-4-gregkh@linuxfoundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On 1/11/23 12:30, Greg Kroah-Hartman wrote: > The driver core is changing to pass some pointers as const, so move > to_ssam_device() to use container_of_const() to handle this change. > to_ssam_device() now properly keeps the const-ness of the pointer passed > into it, while as before it could be lost. > > Cc: Maximilian Luz > Cc: platform-driver-x86@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman > --- > include/linux/surface_aggregator/device.h | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/include/linux/surface_aggregator/device.h b/include/linux/surface_aggregator/device.h > index 46c45d1b6368..24151a0e2c96 100644 > --- a/include/linux/surface_aggregator/device.h > +++ b/include/linux/surface_aggregator/device.h > @@ -229,10 +229,7 @@ static inline bool is_ssam_device(struct device *d) > * Return: Returns a pointer to the &struct ssam_device wrapping the given > * device @d. > */ > -static inline struct ssam_device *to_ssam_device(struct device *d) > -{ > - return container_of(d, struct ssam_device, dev); > -} > +#define to_ssam_device(d) container_of_const(d, struct ssam_device, dev) > > /** > * to_ssam_device_driver() - Casts the given device driver to a SSAM client A small note in addition to the comment by Hans: I think it might be a good idea to convert the to_ssam_device_driver() function as well. I could also send this in as a follow-up patch. Regards, Max