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=-3.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 96A5DC388F7 for ; Mon, 9 Nov 2020 17:32:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 16D8320897 for ; Mon, 9 Nov 2020 17:32:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="07ZpCb8Q"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HbF0oxxx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16D8320897 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cDYFr/QmWQNetUp5FSWIEhghNJO7tfj4IOSXXWJB4GM=; b=07ZpCb8Qgi+b8FO85ScK8gviF NCqthSwxpCb+Su+m+R8KJLk1+BPTToPJYNR22KhM8dmAPtL9f3v3gh4GXPPlhR2S2YDESdFzZsKGW xoJp/txhXZoKQ4d71fsuJ0x3EUGaCe5CeuwFpbItcGsxjDOW1xO1+CvNlcTilHW7vu/vu3dD8HiGC 4ZZTarvknbqwUWT90a4/YqzAKX+BXyiMqmQ/L6+h2umzlpAkFvx2mLSND90I/D4NRkBiezK/A+QZW e5sBnwLyPG46KV+eLl0mXRJJ/NEjmqlLJvskhm331vGhKmheoC9sAg9e+OYQa903c7rKiZkbWo2XJ 8IWrdyjuQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcB15-00051K-7c; Mon, 09 Nov 2020 17:31:43 +0000 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcB12-000508-P9 for linux-arm-kernel@lists.infradead.org; Mon, 09 Nov 2020 17:31:41 +0000 Received: by mail-qv1-xf43.google.com with SMTP id r12so4437454qvq.13 for ; Mon, 09 Nov 2020 09:31:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=HMIHtoNzchBHFVtanLTb2sQZQycOvpPNIxMNPEE2T40=; b=HbF0oxxxVzU/7cNLkG4olbhmHWosI7k82XP7XqE4RfN7gzS/IsIQOILqtxuRGND1QL mV/wDFH7e8arLGMfae9/asPBZskQ/E6SLmy24Vkxo9yJGTMENXNzz5TQ280s5FCCcDYt LOU97Joga1nf2IheV38qi2d2/xMK/qGN+oCdL7PJT171QrYKybUS3leyNjhiOd+linur FLcWlRJsFSrk1dNMKnxhVYod9GZcYYQbQ841u8wd5bDVtzbwZ6uVWSin5mQALyXl0eaG urOLCtWWn/C56covg5TixPVWEHCElwDKeXieFNRtmKiTStjK+FcUEwwkdYK4h9tdZS1a ThRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=HMIHtoNzchBHFVtanLTb2sQZQycOvpPNIxMNPEE2T40=; b=DfCx4Vjigq69Z8tCB5ZP9KEqvcipWfp8+MDECrb2/0mUXf3vKc/96VMCK6sIzgoiPN Pc9H+phWVTK4iu5P/mkmTMvRvsG3wqA7u3TFR3CU6avxCuY8hbhSKnvV/fuO5yLYO+JO j46C9yw4WRAqltrsdbgxghQ22KwMlXhBVQwLsRE/rQ47JM4t1zskjRHdsDnvUaiAnOrp xT7hVKZrUclcQO2tzGQQ4t299dPttpP3IuF1VAlwoUxg1UNO0mNrNFUkQ5l6y5scQlJr kJ7N+JlbwzeptEpDSQqpfGhQSaD314DZYf2tImTlBIJM+Bglj0cNHMrNNq1j1vUSXr5P Isqg== X-Gm-Message-State: AOAM530X+9Yk+sZVlLkTwNyG2dUKWNsiS1FFOI5SNxo9ihiw3bV2PGJ/ TN5TPQ8nGGBj39g0jehvluw= X-Google-Smtp-Source: ABdhPJzpOtrBD8nR+/5Tvg1a/rV7ki4++gxJ6sueoUVdKqES9fgDIPRi/UpOTnN6C6LItoAJFcpq7Q== X-Received: by 2002:a0c:fdcb:: with SMTP id g11mr15613454qvs.58.1604943099203; Mon, 09 Nov 2020 09:31:39 -0800 (PST) Received: from shinobu (072-189-064-225.res.spectrum.com. [72.189.64.225]) by smtp.gmail.com with ESMTPSA id j21sm1606865qtp.10.2020.11.09.09.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 09:31:38 -0800 (PST) Date: Mon, 9 Nov 2020 12:31:23 -0500 From: William Breathitt Gray To: Andy Shevchenko Subject: Re: [PATCH v12 4/4] gpio: xilinx: Utilize generic bitmap_get_value and _set_value Message-ID: <20201109173107.GA14643@shinobu> References: <15a044d3ba23f00c31fd09437bdd3e5924bb91cd.1603055402.git.syednwaris@gmail.com> <20201101150033.GA68138@shinobu> <20201109123411.GA19869@syed> <20201109134128.GA5596@shinobu> <20201109164529.GA28710@syed.domain.name> <20201109171140.GA14045@shinobu> <20201109172220.GI4077@smile.fi.intel.com> MIME-Version: 1.0 In-Reply-To: <20201109172220.GI4077@smile.fi.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201109_123140_857288_A20FE6F8 X-CRM114-Status: GOOD ( 21.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Bartosz Golaszewski , Linus Walleij , "linux-kernel@vger.kernel.org" , Michal Simek , "open list:GPIO SUBSYSTEM" , Andrew Morton , Syed Nayyar Waris , Linux ARM Content-Type: multipart/mixed; boundary="===============7000092101471565555==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7000092101471565555== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DBIVS5p969aUjpLe" Content-Disposition: inline --DBIVS5p969aUjpLe Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 09, 2020 at 07:22:20PM +0200, Andy Shevchenko wrote: > On Mon, Nov 09, 2020 at 12:11:40PM -0500, William Breathitt Gray wrote: > > On Mon, Nov 09, 2020 at 10:15:29PM +0530, Syed Nayyar Waris wrote: > > > On Mon, Nov 09, 2020 at 03:41:53PM +0100, Arnd Bergmann wrote: >=20 > ... >=20 > > > static inline void bitmap_set_value(unsigned long *map, > > > - unsigned long value, > > > + unsigned long value, const size_= t length, > > > unsigned long start, unsigned lo= ng nbits) > > > { > > > const size_t index =3D BIT_WORD(start); > > > @@ -15,6 +15,10 @@ static inline void bitmap_set_value(unsigned long = *map, > > > } else { > > > map[index + 0] &=3D ~BITMAP_FIRST_WORD_MASK(start); > > > map[index + 0] |=3D value << offset; > > > + > > > + if (index + 1 >=3D length) > > > + __builtin_unreachable(); > > > + > > > map[index + 1] &=3D ~BITMAP_LAST_WORD_MASK(start + n= bits); > > > map[index + 1] |=3D value >> space; > > > } > >=20 > > Hi Syed, > >=20 > > Let's rename 'length' to 'nbits' as Arnd suggested, and rename 'nbits' > > to value_width. >=20 > length here is in longs. I guess this is the point of entire patch. Ah yes, this should become 'const unsigned long nbits' and represent the length of the bitmap in bits and not longs. > But to me sounds like it would be better to have simply bitmap_set_value6= 4() / > bitmap_set_value32() with proper optimization done and forget about varia= dic > ones for now. The gpio-xilinx driver can have arbitrary sizes for width[0] and width[1], so unfortunately that means we don't know the start position nor the width of the value beforehand. William Breathitt Gray --DBIVS5p969aUjpLe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEk5I4PDJ2w1cDf/bghvpINdm7VJIFAl+pfOsACgkQhvpINdm7 VJLclhAAqT8dGFX1/kzv3HHKcOJ3cZFrWEnRjD4yfx5iEYcagVfpZEd0Ibfx6VTc Ul87iiN9atP8dKh6yOEEdSwxa1wYuGYSMU5EV2ChgqRUv7HO/bAYG13b1jwoMaks ArOf0ZZvJ5p2XIHkTQRH+wT++e3C1VXmdYnsI/GgWrYM1NFOhUob4OU5AUrN418n r2/bZCiVO5iDFNLUWbpEavtyU2XJY4KL/gwyJWtSJMf3mzN39nvaB9ECE/1aEcaM +iAyOCiP2UExTuDTOtrerCag5H6RfzHlbe+tsWWWhS84bte42cGdpCZG993NyWDc yGECb+8/+D1zuwfv1VMmOv5yXJPZRPnYjYxBTjztYLX28F364kJxGFAK2Mx8UhtD 1gGebf9UJBFytquR2BV7thvWb672b2Gwkd0a+mvg7AF9X7bmtEBds0W7FUJJKpWx bYVS7z+2Ip4TxKrfjHvnaVgky4kwwntuz82CT51pRtPJIz/5oHP69vwJHzl2C/nv JRBUIQTYjG7qiNvXlaG6ENoANMQTO5A17SWfzpyWytBA0sgTlhCfoyzY/VgnxclL ceJi1bMaspiFQh6mtfg6qR1DXqnvKNmyXQ1L1a/DFLm9lW6vf+qGeSKhMarp4+6M 3fPzbOmqgMCp4uV/Ws1+VoIZtCMyCDDPJLI8wMuF2V0j7d68L14= =n0p1 -----END PGP SIGNATURE----- --DBIVS5p969aUjpLe-- --===============7000092101471565555== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============7000092101471565555==--