From patchwork Fri Apr 29 08:42:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 568436 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63AA8C433F5 for ; Fri, 29 Apr 2022 08:43:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355907AbiD2Iqv (ORCPT ); Fri, 29 Apr 2022 04:46:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355961AbiD2Iqo (ORCPT ); Fri, 29 Apr 2022 04:46:44 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 00CBAC400F for ; Fri, 29 Apr 2022 01:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651221806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GpZJ4wX7kOe8KNr9fDnXvQai/0Kn9GYbVZ0gMqgfC8g=; b=duY4kW6OR2jlslzH/efDe0mnfkyisEJGZ04jZ9oF6/d0bJT+jDGUpS8dGhqAeZfDefGofn Xd+BQqUpuzVndJdE0Ed5UlYD43+Jsof0JcUhdx7nU+K6HLwZCG3sXUwlUTl3nBMobXFgEO S7aFoU5xRqBmxav4+MVe7oBV4sGCx2Y= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-453-fnt9mg_JP-Ku4AqjLkQ5Hg-1; Fri, 29 Apr 2022 04:43:24 -0400 X-MC-Unique: fnt9mg_JP-Ku4AqjLkQ5Hg-1 Received: by mail-wm1-f72.google.com with SMTP id bh7-20020a05600c3d0700b003940829b48dso3113281wmb.1 for ; Fri, 29 Apr 2022 01:43:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GpZJ4wX7kOe8KNr9fDnXvQai/0Kn9GYbVZ0gMqgfC8g=; b=DzorNLrqUhMsATNXyCeBGc2Uwrb61367n9iWCisIrdnf7w5NOesrAHeRoZrByy0EkO KeNIRCgr3iHK3QiCr7qXHJHUwxXdoS26Xnh9CUCm64aD96qAmf9ZuWbg+MroUkPZrtOw 7uiDx6O05VblVIJ8WcogCiYWDUkTEMiajoDGQJe/4hjtDQ1loK+oMuTlxEOo2zMx9jfc 6CSVa2uJNuLzESkE2/caIxaOo/jWoU0HYOm752b363/3Swf7p/Bw2YQEHJ1uLWXmOlAr DsK0ZMhUgt34F/AF6FLc5P47cKuVvox2ExZVBpdKZBoPwigQv0fhyxqnFDn3OraMkV0p +vnQ== X-Gm-Message-State: AOAM531uPu6nqwuY5VzrDJFFQn/EEFoPEfcxQ6i72nVaVk9hJCtfxmmm QA1TyFjbHSJEg2rAF+x3km72D1+3ZhLqToFiwX/wSX6dOLL4bcV8/pwtAzFffeV7U7S/3t52Qi6 ZGTFc1zB7jtwhvAWbE91qEjg= X-Received: by 2002:a05:600c:4ec6:b0:394:1f35:4c69 with SMTP id g6-20020a05600c4ec600b003941f354c69mr1752575wmq.61.1651221802221; Fri, 29 Apr 2022 01:43:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhmIBm7Rgju2BXAxf7jfHuCnxn2Uoy7l4mQ/iKVv2qM/3Q7Bt+zoSMdfHM0/61ANAlGkIsNA== X-Received: by 2002:a05:600c:4ec6:b0:394:1f35:4c69 with SMTP id g6-20020a05600c4ec600b003941f354c69mr1752548wmq.61.1651221802012; Fri, 29 Apr 2022 01:43:22 -0700 (PDT) Received: from minerva.home ([92.176.231.205]) by smtp.gmail.com with ESMTPSA id f7-20020a05600c4e8700b00393f1393abfsm7199256wmq.41.2022.04.29.01.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 01:43:21 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, Daniel Vetter , Greg Kroah-Hartman , Thomas Zimmermann , kernel test robot , Jens Frederich , Jon Nettleton , linux-staging@lists.linux.dev, Daniel Vetter , Javier Martinez Canillas , Daniel Vetter , Helge Deller , Matthew Wilcox , Sam Ravnborg , Tetsuo Handa , Zhen Lei , Alex Deucher , Xiyu Yang , linux-fbdev@vger.kernel.org, Zheyu Ma , Guenter Roeck , Changcheng Deng Subject: [RFC PATCH v4 11/11] fbdev: Make registered_fb[] private to fbmem.c Date: Fri, 29 Apr 2022 10:42:53 +0200 Message-Id: <20220429084253.1085911-12-javierm@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220429084253.1085911-1-javierm@redhat.com> References: <20220429084253.1085911-1-javierm@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From: Daniel Vetter Well except when the olpc dcon fbdev driver is enabled, that thing digs around in there in rather unfixable ways. Cc oldc_dcon maintainers as fyi. v2: I typoed the config name (0day) Cc: kernel test robot Cc: Jens Frederich Cc: Jon Nettleton Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Reviewed-by: Javier Martinez Canillas Cc: Daniel Vetter Cc: Helge Deller Cc: Matthew Wilcox Cc: Sam Ravnborg Cc: Tetsuo Handa Cc: Zhen Lei Cc: Alex Deucher Cc: Xiyu Yang Cc: linux-fbdev@vger.kernel.org Cc: Zheyu Ma Cc: Guenter Roeck Signed-off-by: Javier Martinez Canillas --- (no changes since v1) drivers/video/fbdev/core/fbmem.c | 8 ++++++-- include/linux/fb.h | 7 +++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 7583296481b0..1ce5b0f3abd4 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -50,10 +50,14 @@ static DEFINE_MUTEX(registration_lock); struct fb_info *registered_fb[FB_MAX] __read_mostly; -EXPORT_SYMBOL(registered_fb); - int num_registered_fb __read_mostly; +#if IS_ENABLED(CONFIG_FB_OLPC_DCON) +EXPORT_SYMBOL(registered_fb); EXPORT_SYMBOL(num_registered_fb); +#endif +#define for_each_registered_fb(i) \ + for (i = 0; i < FB_MAX; i++) \ + if (!registered_fb[i]) {} else bool fb_center_logo __read_mostly; diff --git a/include/linux/fb.h b/include/linux/fb.h index b781bc721113..208bca693b33 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -623,16 +623,15 @@ extern int fb_get_color_depth(struct fb_var_screeninfo *var, extern int fb_get_options(const char *name, char **option); extern int fb_new_modelist(struct fb_info *info); +#if IS_ENABLED(CONFIG_FB_OLPC_DCON) extern struct fb_info *registered_fb[FB_MAX]; + extern int num_registered_fb; +#endif extern bool fb_center_logo; extern int fb_logo_count; extern struct class *fb_class; -#define for_each_registered_fb(i) \ - for (i = 0; i < FB_MAX; i++) \ - if (!registered_fb[i]) {} else - static inline void lock_fb_info(struct fb_info *info) { mutex_lock(&info->lock);