From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1516C433EF for ; Tue, 12 Apr 2022 11:27:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 193C110E67C; Tue, 12 Apr 2022 11:27:48 +0000 (UTC) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6CF6210E67C for ; Tue, 12 Apr 2022 11:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649762867; x=1681298867; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=A8L7F1aXAv1zmc7BrwX0jr9a4044fPUJAWnmDOdYuoU=; b=fg8Dvsv9eIuxPlf+V9lHvyJ35UZzSCud8sQ58D7ILqUkAdguxUQ3Io3H z1uj4WdPkd29bwzpIJVTJDeKz+DwJufLze4hVPnahkl9tbzXYhg9dN34C ja9tswulHAdw640mwuDySp0RzqtidvVZJfyfZd2QnzMzwjTnX66SkCJM3 +WbncXgDp6cQtr2JWVdN8BCZeqcd7VgiCB2TuZKBlFISAxMg+1N2rGgcw mz5xuzKYfU2EzyhCRmLs3AheoB7c5F9mLzFB1BreOwt92F5V7t3AaNaL7 agIYFTNfYrPQORVjurzndCN7+DAOm2F+w0IjWvTPZwPVvBFqRmv9bkAv3 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10314"; a="322797313" X-IronPort-AV: E=Sophos;i="5.90,253,1643702400"; d="scan'208";a="322797313" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2022 04:26:06 -0700 X-IronPort-AV: E=Sophos;i="5.90,253,1643702400"; d="scan'208";a="526002248" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2022 04:26:03 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1neEbI-001Yl0-8d; Tue, 12 Apr 2022 14:22:24 +0300 Date: Tue, 12 Apr 2022 14:22:24 +0300 From: Andy Shevchenko To: Javier Martinez Canillas Subject: Re: [PATCH v2 4/5] drm/solomon: Move device info from ssd130x-i2c to the core driver Message-ID: References: <20220411211243.11121-1-javierm@redhat.com> <20220411211243.11121-5-javierm@redhat.com> <4128b288-2b9a-f9cd-01f3-a1d50d3e10bb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Linux Kernel Mailing List , DRI Development , Mark Brown , Geert Uytterhoeven , Chen-Yu Tsai Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Apr 12, 2022 at 02:21:08PM +0300, Andy Shevchenko wrote: > On Tue, Apr 12, 2022 at 10:07:02AM +0200, Javier Martinez Canillas wrote: > > On 4/12/22 09:23, Geert Uytterhoeven wrote: > > > On Mon, Apr 11, 2022 at 11:12 PM Javier Martinez Canillas > > > wrote: ... > > >> - ssd130x->device_info = device_get_match_data(dev); > > >> + > > >> + variant = (enum ssd130x_variants)device_get_match_data(dev); > > > > > > (uintptr_t), to avoid a cast from pointer to integer of different > > > size warning. > > > > > > > Indeed. The kernel test robot reported the same. > > Not only because of this, but also with the non-NULL pointers I prefer the old > style without ugly castings. > > Instead, you may export the array (in the driver's namespace) and use > &info[ID] pointer for the specific device info. Note that device_get_match_data() has no clue if the data is absent or data == (void *)0. -- With Best Regards, Andy Shevchenko