Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp136370rdb; Tue, 19 Dec 2023 11:32:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEO2Edlh61pL1YISCYZ1998g3qS0XTccZycvM+BDCy/rPViT50/VJ/l6WbkhB1+C15fci72 X-Received: by 2002:a9d:6f01:0:b0:6db:a6da:a6ad with SMTP id n1-20020a9d6f01000000b006dba6daa6admr692127otq.37.1703014355129; Tue, 19 Dec 2023 11:32:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703014355; cv=none; d=google.com; s=arc-20160816; b=kVLZ9vL6xq3mKb1RGxiajk+E/8xIUQOJgcD2hzWX+uLQqPVchDYuKcrGSW+GJ1hQEz HXXJMwJ76xvVMonqUEUhnaV3FBW522B3otrYWYggzdKC1mVK2IZrcgiGvnzr4xNuFd5Y Rmq4uEIZ8ghWkAL4g5qU+On9x511yDFYvcu0eQAgsuBvwLzX/M1hR2OhF22gXoiKEazT S+CnZnHOFA6ODE1F96+5fHBFgFzJAohwwWdkh2UBEltfVjEDp2sGqS57nXNfnE7dB8qR CiKE++gmiSury8CAw77YPoyF9tdXUGk/kzb3nwoZExXz6w9roGE5y7h0E3B2fOP4cKZy A1tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=IF8GvvowDjNbUwrAOPiYPKi0zKWqFwVvQy27RkH1Gsk=; fh=ey6H4i4f2tZPYhrzR1VGKYRRfHBsN9KHWPrmzhfGYmU=; b=cf8lwdxe+Bv6QCSBT3u2vBj8p3URFPAnks29PFyXeeH58nTYIAHWJbmPXElUi0ElUo 6Kfvjz+lKmD8dAxi9wT4lsbeaFBEIK2T4oNS/9MUOr8lZYtAVFGjlsNvfZBos3fve1ri zAdoxP+9R3Ktnlm0Qk++GrwqWCL+Nh5X4t641aKt6sixMITxQPwYpKVUaGNK+1sP2J/k zXXLJaDdHOGEu5BUAZtAMi2eHd5ztFCL/dDJsZQI3BCNLW2qVpY4MSa1OroeRG4123Ln lJxR/SofxklvkGGAV/MHoaHfFi382t7ItyWWFFFTBmZFrkEtQW7UUxFri/QHx7H5BURf IuCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EUlFPhz6; spf=pass (google.com: domain of linux-kernel+bounces-5871-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5871-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jf25-20020a05610217d900b004669c9a1d86si777438vsb.521.2023.12.19.11.32.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 11:32:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5871-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EUlFPhz6; spf=pass (google.com: domain of linux-kernel+bounces-5871-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5871-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D4EB01C24BE3 for ; Tue, 19 Dec 2023 19:32:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4769639851; Tue, 19 Dec 2023 19:32:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EUlFPhz6" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AEAF38F8B; Tue, 19 Dec 2023 19:32:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40c60dfa5bfso58503255e9.0; Tue, 19 Dec 2023 11:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703014345; x=1703619145; darn=vger.kernel.org; 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=IF8GvvowDjNbUwrAOPiYPKi0zKWqFwVvQy27RkH1Gsk=; b=EUlFPhz6a1dx/qOW6Dt+QoNIEToLKIwgbPwPu1N/A4FQqjCRC414mAJW/k5dgYzM0O RmzDTnjVJsJvQ2BkLcwlS/nZXKg594MJ/uwO17UFUQUlfmiJ6mwyE+BHKdy5JZAtZGfy laY5MEdcIc4vwlhdelUAN6acRv6WKlHHW23QP9McLuy2ZkmwBWrDqSfe3W09i/9ArHff k50IfEg9OkL4e4XbuF09KeeDjNNBodxAvwJyyqK2YCvR/OLAZ6SQ/qd7ejOltAabTWmS ZTWzypNxNuZGlpPtK+PV7gr6piowmvdJZO/6A7I36k+nP86VPgxvI+E2C80nwL5ZjKHj tNxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703014345; x=1703619145; 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=IF8GvvowDjNbUwrAOPiYPKi0zKWqFwVvQy27RkH1Gsk=; b=qN9K0dXYHwTj7RA2/E8esIxw/mcpQkBrW5AvSruZMecZtvSUkxeW3oNANTHtQSOpnT DkCFgVNDvJ3gz29rZzU/bo5CC87uy3uuP/Z2IeFURIjVZ8pKd930W5Q+guil9pIWv9vk w3baH4CuObKP0b4UCVU5TQbnBQl9G6o9df0AYBzPfKXyFN/vw14Z1j96HVZwLZ7dV1+a yyBi4HuBGGh/jeCwmUMFyy/nDCj2HKZN3QVHsnezvwrUdUAzEizcJh8HNKrtoEvxKHyD FjGbbO7WSLhH8UgmnGfCC3PJ50J2Lvi7i7gb2uvn2hw7zZKDZt5ISORo9mybCsMXr/Rd kZQA== X-Gm-Message-State: AOJu0YxvoBLZ4IEm60HiYPIGWi18POQmWTNwHayIaEfRSI5/7OLuiLaQ vxhtIHHQXsqwq6Yyk0nKUYM= X-Received: by 2002:a05:600c:5020:b0:40c:6ca7:f001 with SMTP id n32-20020a05600c502000b0040c6ca7f001mr4330598wmr.56.1703014344981; Tue, 19 Dec 2023 11:32:24 -0800 (PST) Received: from ?IPV6:2a02:8071:b783:140:927c:82ba:d32d:99c1? ([2a02:8071:b783:140:927c:82ba:d32d:99c1]) by smtp.gmail.com with ESMTPSA id hg12-20020a05600c538c00b0040c41846923sm4130537wmb.26.2023.12.19.11.32.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Dec 2023 11:32:24 -0800 (PST) Message-ID: Date: Tue, 19 Dec 2023 20:32:22 +0100 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] platform/surface: aggregator: make ssam_bus_type constant and static Content-Language: en-US To: Greg Kroah-Hartman , hdegoede@redhat.com Cc: linux-kernel@vger.kernel.org, =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , platform-driver-x86@vger.kernel.org References: <2023121957-tapered-upswing-8326@gregkh> From: Maximilian Luz In-Reply-To: <2023121957-tapered-upswing-8326@gregkh> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 12/19/23 18:18, Greg Kroah-Hartman wrote: > Now that the driver core can properly handle constant struct bus_type, > move the ssam_bus_type variable to be a constant structure as well, > placing it into read-only memory which can not be modified at runtime. > > It's also never used outside of > drivers/platform/surface/aggregator/bus.c so make it static and don't > export it as no one is using it. Thanks! Looks good to me. Reviewed-by: Maximilian Luz > Cc: Maximilian Luz > Cc: Hans de Goede > Cc: "Ilpo Järvinen" > Cc: platform-driver-x86@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman > --- > drivers/platform/surface/aggregator/bus.c | 5 +++-- > include/linux/surface_aggregator/device.h | 1 - > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/platform/surface/aggregator/bus.c b/drivers/platform/surface/aggregator/bus.c > index 42ccd7f1c9b9..118caa651bec 100644 > --- a/drivers/platform/surface/aggregator/bus.c > +++ b/drivers/platform/surface/aggregator/bus.c > @@ -35,6 +35,8 @@ static struct attribute *ssam_device_attrs[] = { > }; > ATTRIBUTE_GROUPS(ssam_device); > > +static const struct bus_type ssam_bus_type; > + > static int ssam_device_uevent(const struct device *dev, struct kobj_uevent_env *env) > { > const struct ssam_device *sdev = to_ssam_device(dev); > @@ -329,13 +331,12 @@ static void ssam_bus_remove(struct device *dev) > sdrv->remove(to_ssam_device(dev)); > } > > -struct bus_type ssam_bus_type = { > +static const struct bus_type ssam_bus_type = { > .name = "surface_aggregator", > .match = ssam_bus_match, > .probe = ssam_bus_probe, > .remove = ssam_bus_remove, > }; > -EXPORT_SYMBOL_GPL(ssam_bus_type); > > /** > * __ssam_device_driver_register() - Register a SSAM client device driver. > diff --git a/include/linux/surface_aggregator/device.h b/include/linux/surface_aggregator/device.h > index 42b249b4c24b..8cd8c38cf3f3 100644 > --- a/include/linux/surface_aggregator/device.h > +++ b/include/linux/surface_aggregator/device.h > @@ -193,7 +193,6 @@ struct ssam_device_driver { > > #ifdef CONFIG_SURFACE_AGGREGATOR_BUS > > -extern struct bus_type ssam_bus_type; > extern const struct device_type ssam_device_type; > > /**