Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp648247ybg; Mon, 1 Jun 2020 10:40:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1JOkZS2NiPPZ5RcLaDrwHAqjbcOXv9ntrzv2zSEV5G2Wf3gQU1GaVlGblZZ93Roqbn5PH X-Received: by 2002:a17:906:4056:: with SMTP id y22mr17472768ejj.304.1591033223907; Mon, 01 Jun 2020 10:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591033223; cv=none; d=google.com; s=arc-20160816; b=K1Toh4chGEUFgdx+N+yUie6FsHklqbLM2iCoH2Keia4k0KR6Qf+d1fbdSBeV1OILcB zWDIGK+z/MJYB/BIWTTllhvLPjbk6AsMrqIQgG+LM4xzn4+/C6rtqfBaqjYCBZqoi1FW MEKEHzbx/D+9VuMr97m/MOm2bUUG/dAFkQ285ogGMCeeydNTRvGaHLWNAVH3EHDRIAWY +mDfY2g8q6fZGqkmwlkjjdczXYCq36exMunTnDuxyu8TKaoagYnO5pYQ4hr8OX/9KSNj S1uPbSBE8uhlQ2ImWXegeI/B9ZW+6aoQHxG6A/8LfhGp7AZyUazbPVZDhvugq27Lcybr TH7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dwRvsyuWdlz5Sj9R8UPjwCWgliWYDzR4m5EptJzID/M=; b=DtnSBCPolR/pf+J756HOV8fbIn60YLHjnwC2UJmYqA4b+ijsxxZpogVR2PWStUyQGF rETTffOOu6FoolO9SCRIskI2FXpu5Y46PKSEn89uFxKsvqLz97PnNj7epFzt/e2EAbLL zeE6sOyQcrol5BqtieVZ+P2se/aaDQGnJSBxUGAbbcpaiQoIxNhsey9CsHAmXYkD8QTQ kMU5SvC2M3tnnmO3JcHdXzFghkF2XBoxyGhpKWs628UKpPNZVcLOYklY0rKECmxBS3ua 1/CcqV0IRba+Rqn/5swulYw8ML718qRIm83zGXNePplaQvKIRCO1FudH9hfaL7kVmYxM BjRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ni6vAZlZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u24si105867ejo.396.2020.06.01.10.39.53; Mon, 01 Jun 2020 10:40:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ni6vAZlZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727971AbgFARIv (ORCPT + 99 others); Mon, 1 Jun 2020 13:08:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:49702 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727795AbgFARIu (ORCPT ); Mon, 1 Jun 2020 13:08:50 -0400 Received: from mail-oo1-f54.google.com (mail-oo1-f54.google.com [209.85.161.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 77F5D207D0; Mon, 1 Jun 2020 17:08:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591031329; bh=U4zySYo9+Zn4LG0NqTAIuOjQNwa7638vn5i7EqhQmGc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ni6vAZlZT4tj1xl51yOTbBxf5AwGuYWF7t8Rps7Sqztp3gZOZLVqUOrKv5yhUVa5Y qZlEnxrRdplCiICKkBvni4EjL4RXM5OQlcSmYIewhdE3iN8gFnlE5AUnW1H5Ql4qMl 2MSFYfDkprtS06cQXSsTxuHUJiK4fn6SU1enW+AI= Received: by mail-oo1-f54.google.com with SMTP id h7so1558501ooc.9; Mon, 01 Jun 2020 10:08:49 -0700 (PDT) X-Gm-Message-State: AOAM530KkjzcWllcaTBi4LLgadeAkBBvPtTE1bfnYJXmUw08EAkGveZ2 tecXVbvrz0226++kt6XNigC34xvFFN585rjuGg== X-Received: by 2002:a4a:2c88:: with SMTP id o130mr17580139ooo.81.1591031328789; Mon, 01 Jun 2020 10:08:48 -0700 (PDT) MIME-Version: 1.0 References: <20200527122525.6929-1-Sergey.Semin@baikalelectronics.ru> <20200527141517.22677-1-Sergey.Semin@baikalelectronics.ru> <20200530093152.GA1038@ninjato> In-Reply-To: <20200530093152.GA1038@ninjato> From: Rob Herring Date: Mon, 1 Jun 2020 11:08:37 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] check: Add 10bit/slave i2c reg flags support To: Wolfram Sang Cc: Serge Semin , Devicetree Compiler , Serge Semin , Alexey Malahov , Thomas Bogendoerfer , Jarkko Nikula , Andy Shevchenko , Frank Rowand , devicetree@vger.kernel.org, Linux I2C , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 30, 2020 at 3:32 AM Wolfram Sang wrote: > > > > + addr = reg & 0x3FFFFFFFU; > > + snprintf(unit_addr, sizeof(unit_addr), "%x", addr); > > Hmm, this hardcoded value will not work if we ever need to add another > bit. I hope this will never happen, though. I had this concern and requested the first time this was submitted (and abandoned) to just mask out the top byte. However, Joel's version of this fix[1] does some actual checks on 10-bit addressing, so I've dropped that request. > > + if ((reg & (1U << 31)) && addr > 0x3ff) > > Same here with bit 31. I haven't checked DTC but can't we import the > header with the defines into the project? Or is this then a circular > dependency? Easier to just duplicate the define here which Joel's patches do. Rob [1] https://www.spinics.net/lists/devicetree-compiler/msg03196.html