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 9D6CBC433F5 for ; Tue, 12 Apr 2022 12:45:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B1B3010E9DD; Tue, 12 Apr 2022 12:45:46 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 501E310E9DD for ; Tue, 12 Apr 2022 12:45:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649767543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tZ33BjHrDwv5LDhGjdBOryVj91womQA/19SWnvr7iKo=; b=bbgXXAh86V+ylP/asKm03NUTzSY6X1ywgR9AN9kBLX4qolvAAgYpN7fZoJnHDFvbOJ4K+R 5fukNzoXaAFHdv4FmsNd62JU1gC+l+SaNxHcc9+nwU494DcN1sUg50E45i6sNIzbNC6ki/ UqqpPzZwaGbAVxMnO7XoDn8qHHqeA+M= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-107-cHlOf1wYPraPXKCcmnbfKA-1; Tue, 12 Apr 2022 08:45:42 -0400 X-MC-Unique: cHlOf1wYPraPXKCcmnbfKA-1 Received: by mail-wr1-f71.google.com with SMTP id v3-20020adf8b43000000b00205e463b017so3992772wra.10 for ; Tue, 12 Apr 2022 05:45:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=tZ33BjHrDwv5LDhGjdBOryVj91womQA/19SWnvr7iKo=; b=r6ZlkWWQxssTRFcZHie1JYKDpKhh7Yl+u+vTD6l6ATnUBQSfBBKSLlrbjPX0Sfh9Iq g2ppSJfKPH+cF4ZLZPnVBkORpQsFmV7gvhwk0kBSHg/EzkGJ86Om+FZS5G5F/o3Y4w+X DrDQu+i3uUsrUUU5hgieg3s1AQwNhbajuPwY2SczxoHSm/sUpHSajFHNN06hOB7HTBav kl3n666FjMUhrnTt175dq3fPicgCMwdMp8s1Y1N9RhJZzOG0zgzgAdRPQ49SXRSfdOsq VHH3gXKAGxf+FklHNHjMT0rVmkCYvnaCMHgFKWBQboboxkv+0xibxfGjUjEKx5eITG9J I+cw== X-Gm-Message-State: AOAM5331ga9j6dw33fwrTed5EegSmFblw/uRVpm8qvIpAqKnPqEy1NVA imQkJb84PU4648biPhKbITyk1FZZPWvD4nrgUVXmVsbk/XRZ8tsRJebopel5nLzqFGclLZkzSRD Mo21Qm65uUne/2FEFiURdVTxOFTpG X-Received: by 2002:a5d:6b4c:0:b0:1e6:8ece:62e8 with SMTP id x12-20020a5d6b4c000000b001e68ece62e8mr29078284wrw.201.1649767541787; Tue, 12 Apr 2022 05:45:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUqWO+Fp2x3i5NTSt5YGXdfhi1f+8zoD8yvWBy27pRBGSkplwJquSYzx/QHYB7zw1nrfYm3Q== X-Received: by 2002:a5d:6b4c:0:b0:1e6:8ece:62e8 with SMTP id x12-20020a5d6b4c000000b001e68ece62e8mr29078264wrw.201.1649767541566; Tue, 12 Apr 2022 05:45:41 -0700 (PDT) Received: from [192.168.1.102] ([92.176.231.205]) by smtp.gmail.com with ESMTPSA id q16-20020a1ce910000000b0038eabd31749sm2641252wmc.32.2022.04.12.05.45.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Apr 2022 05:45:41 -0700 (PDT) Message-ID: Date: Tue, 12 Apr 2022 14:45:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2 4/5] drm/solomon: Move device info from ssd130x-i2c to the core driver To: Andy Shevchenko References: <20220411211243.11121-1-javierm@redhat.com> <20220411211243.11121-5-javierm@redhat.com> <4128b288-2b9a-f9cd-01f3-a1d50d3e10bb@redhat.com> From: Javier Martinez Canillas In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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" Hello Andy, Thanks for your feedback. On 4/12/22 13:21, 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. > That's a great idea! I'll do that in v3. -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0698C433EF for ; Tue, 12 Apr 2022 13:03:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354948AbiDLNFY (ORCPT ); Tue, 12 Apr 2022 09:05:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356412AbiDLND2 (ORCPT ); Tue, 12 Apr 2022 09:03:28 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7FA0713CC8 for ; Tue, 12 Apr 2022 05:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649767544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tZ33BjHrDwv5LDhGjdBOryVj91womQA/19SWnvr7iKo=; b=JToA5CBpMhbsVwOCmyGRE5/N5rv3xQWX7JF+fC83569ED4OwYTHne3sEvCKwx3bn1K+h5v r5g4RHju7MxBxMjpEA1S8ddRtKcjSAN0NTzDfSVwOWdmkrOtCSepXybEdWej2GpeLrFVrC cBh5XR9qnO3KcSxYZjo1RGB+w5xtcaQ= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-422-7G2Zv_EdNz2pJtFj6H4zNg-1; Tue, 12 Apr 2022 08:45:43 -0400 X-MC-Unique: 7G2Zv_EdNz2pJtFj6H4zNg-1 Received: by mail-wr1-f71.google.com with SMTP id r10-20020adfc10a000000b00207a2c7bcf6so1416905wre.0 for ; Tue, 12 Apr 2022 05:45:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=tZ33BjHrDwv5LDhGjdBOryVj91womQA/19SWnvr7iKo=; b=u3O4n7+ddwpTNcAqxROHHfJBZ1KJCY80dNqpj/o3rkB/M6QnARUzIXOb3X9FD7Tlnm ZNPB/FFhwiqzhtbQcKFcN/B5Ygbz8IkVnLSQ7Hxn9kEW79JflTIzGxn3ZvwRdAC+SoIN nddUGTBjdPVQlfkfnH1CIOZNZ4jyqhgs8Jp+Bu/ssYt3kWrRfUJMb0DTa/AMqL3eSWey 6ofMsnNkhO/k2/rcvs9Sy/bT6Hr76bEuIHabJG/CXAJakkZh3avEMM4+LtuzFWTcdE2f xlFLu6HS44/KPdzyt+z1RdSYxGUlRtdJtxoPqpqds0o9CUUlmuF5/HEsUfCkEU7D+8kp uhPQ== X-Gm-Message-State: AOAM531aDDB2x2BzPPE9GEzcxeeATRIa/HZdkXKEKu5VOTWJNJHCrB4T tB4/GhekFTeL3XznrhH/HwgwP++C7OcKmj7lmA2OpAaQc1vBYwGYTpP3smSinf12iHFALx3+/aN pPlQJ8D/+QcIBgi/TWwXyamGJ X-Received: by 2002:a5d:6b4c:0:b0:1e6:8ece:62e8 with SMTP id x12-20020a5d6b4c000000b001e68ece62e8mr29078280wrw.201.1649767541786; Tue, 12 Apr 2022 05:45:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUqWO+Fp2x3i5NTSt5YGXdfhi1f+8zoD8yvWBy27pRBGSkplwJquSYzx/QHYB7zw1nrfYm3Q== X-Received: by 2002:a5d:6b4c:0:b0:1e6:8ece:62e8 with SMTP id x12-20020a5d6b4c000000b001e68ece62e8mr29078264wrw.201.1649767541566; Tue, 12 Apr 2022 05:45:41 -0700 (PDT) Received: from [192.168.1.102] ([92.176.231.205]) by smtp.gmail.com with ESMTPSA id q16-20020a1ce910000000b0038eabd31749sm2641252wmc.32.2022.04.12.05.45.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Apr 2022 05:45:41 -0700 (PDT) Message-ID: Date: Tue, 12 Apr 2022 14:45:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2 4/5] drm/solomon: Move device info from ssd130x-i2c to the core driver Content-Language: en-US To: Andy Shevchenko Cc: Geert Uytterhoeven , Linux Kernel Mailing List , Rob Herring , DRI Development , Neil Armstrong , Mark Brown , Chen-Yu Tsai , Daniel Vetter , David Airlie References: <20220411211243.11121-1-javierm@redhat.com> <20220411211243.11121-5-javierm@redhat.com> <4128b288-2b9a-f9cd-01f3-a1d50d3e10bb@redhat.com> From: Javier Martinez Canillas In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Andy, Thanks for your feedback. On 4/12/22 13:21, 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. > That's a great idea! I'll do that in v3. -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat