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 X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92BE3C2D0F4 for ; Thu, 2 Apr 2020 12:15:32 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C5ED206F8 for ; Thu, 2 Apr 2020 12:15:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="Z58ViC4P"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="AmxUv3+K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C5ED206F8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1jJykT-0008Au-3I; Thu, 02 Apr 2020 08:15:05 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jJykR-0008Ao-9c for kernelnewbies@kernelnewbies.org; Thu, 02 Apr 2020 08:15:03 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 8DFF45C027F; Thu, 2 Apr 2020 08:15:01 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 02 Apr 2020 08:15:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=wS/r3ECUcPDbrqyxBQNKOqI+bCJ dV+ZX20CooLEgLgo=; b=Z58ViC4PzIOQBdjljl1jT4WDKQ730aiWi3AZ3cCU2Tg 3RKNMFXSNvzzXeIdF305Z8bhz+XObdECdTPxW4PfGAzRy/RHYV6PPeXckvOr2R1l CZcBAwSJW3SSVDBYubpgT6XEptd+zDdTso/u6d0r0IN0deVuOemaCPadLRKqUPMi x2ddxYD5kDkd4/hZOclimBxVmxvEKlOpHGQngJIBs1fhOqMNcYqaMWAL0Sx9JQov sG7XgFQNAEIxBDIR4sXBt/OWlJJpseZVRlpX/pvnPXcDADa3YlY0rElx1hYkXe4Z UwkHygZq0zLgy56fx4JF0NtHI5sp2Lod9fvrAQKxbuQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=wS/r3E CUcPDbrqyxBQNKOqI+bCJdV+ZX20CooLEgLgo=; b=AmxUv3+KVzCCKPL+75Azco vbgaPoqwkh00wX5ywL4MQ9IUijpTkSOK6+pu2Ir/6NEHy1PPO9GNYpi2XthsEeSY 0vOjETfvbxTWuVzmf4roG++cU3shdY0ldo/A1jyt475k4KFYAsJQ6meaTnCPfljq cieVIaN3jZhHngOAvjdGVz2qYyEp2pyIkYNd3MaU2JYpntK4TsC16YtN43Ar6ekH M+7Zn2mQ6ZUyz+XY1+EgvOKrmGVS+nBllMoTf1ZpSNm3DKjMBvUdepGVGfw5OhId e2UOdMbnJ9bps4r1mO0xg0fDcghXz884QCh/w8buIp+7hnZmpIrwpl8cK+Qyxpog == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrtdeggdeggecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepifhrvghgucfm jfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecuffhomhgrihhnpehgihhthhhusgdrtg homhenucfkphepkeefrdekiedrkeelrddutdejnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id E300E306CDED; Thu, 2 Apr 2020 08:14:59 -0400 (EDT) Date: Thu, 2 Apr 2020 14:14:56 +0200 From: Greg KH To: Tomek The Messenger Subject: Re: how to check regmap start address Message-ID: <20200402121456.GB2773016@kroah.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Thu, Apr 02, 2020 at 01:48:23PM +0200, Tomek The Messenger wrote: > Hi > Let's see how it looks: > https://github.com/u-boot/u-boot/blob/master/include/regmap.h > > I first time ever see such thing like this: > struct regmap_range { > ulong start; > ulong size; > }; > struct regmap { > enum regmap_endianness_t endianness; > int range_count; > struct regmap_range ranges[0]; > }; > > How I can get access to variable ranges it if is 0 size? Who develops this > one and who reviewed:) It is very common and standard C coding style. It happens all the time when you have a variable of unknown length at declaration time. > Anyway If I have pointer to regmap can I check what is start variable in > some other way? What other way do you need to check it? Why do you think the above code is incorrect? What do you think it should look like? thanks, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies