Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp377150rdb; Thu, 30 Nov 2023 07:11:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGz/ixO7WAUftz2H34XroZfr8b+y7OyvU7KaJFR94+K+YdF7508ErnIcRoCaA64BV+vC6a1 X-Received: by 2002:a92:d64c:0:b0:35c:87da:3cb9 with SMTP id x12-20020a92d64c000000b0035c87da3cb9mr18153395ilp.19.1701357107373; Thu, 30 Nov 2023 07:11:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701357107; cv=none; d=google.com; s=arc-20160816; b=W1CHHwY/EJIzoxoLFrTqs5P/H+OLTrOKqr402Y3oHjf7+VHSkHml8pxT0rdqweki4m FEaoybt7Elrd64GpHARD4u1IE4CMrHFZEjzsrSX9l1kDnDvNNA9K6fCVJOaA7M6GvL/j h0V9yg541c0+sbDDL5OC7mbpsU/s00XTDcYq3uQ4bY2qEWOMjR3yVrBi+h0XxBJahKp1 C5G8maY22dEnenmT9EsLV2U3Mj070efoqTG9yTkuY+fowlIbyhSYxLbS8GJB2PXote51 V1xh5iER69P/TZ37ne6K9Tt2Uz95YpjeHaOhkcjzuOgvKEhdkNFqX/QRWTRSvjTNiWss RzAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=65x8xs7/Ug+eGRF3Q+RLiswQEr4hdxkkx4yPgUFKNFs=; fh=9/pCLzhV3bV3ND8S1XaiCNIRLIWbL/h2Y5tiqpO1jWk=; b=oc5NQexGqCeiTasmi+DgiM8MBHh10kmwo9UtGszqD+yJqy8W0z4qJDLfU2kM/1QFbY BUKkRg1OBH6xrVE7ALAFmmMjucK5mJpMhZvy84dAnLDKb2ci9OaCa2SzPoLpokZnDBKk XQtEnshtzueDWz8H0HHUiKrCV6Aj3BkGEMo4z9G8cyFyzoHAc0IxSEBId0q+EBMptCiw 1FyKTMe1IAxZDbxEAMO+oF1x7YawIMCsCwx9QGK3tr3GQV7ZSSFmP7TBndIhCF7p21pl KAvHiGrkYj/lT9mL7sF0TcL2N5rECc+3uyrQ9+jJztZfX4WZ2SZtxRxZ0fiVDG5gIufC l1Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Adoyg17D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id bh10-20020a056a02020a00b005b8ebb76177si1587312pgb.561.2023.11.30.07.11.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 07:11:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Adoyg17D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 847B1807E41D; Thu, 30 Nov 2023 07:11:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346118AbjK3PKt (ORCPT + 99 others); Thu, 30 Nov 2023 10:10:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346053AbjK3PKs (ORCPT ); Thu, 30 Nov 2023 10:10:48 -0500 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0F3F194 for ; Thu, 30 Nov 2023 07:10:54 -0800 (PST) Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-67a51d80a02so4928966d6.2 for ; Thu, 30 Nov 2023 07:10:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701357054; x=1701961854; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=65x8xs7/Ug+eGRF3Q+RLiswQEr4hdxkkx4yPgUFKNFs=; b=Adoyg17DzTPrgrP9gEdn5Nis5Nm4Qd9wjk7tRQylZX2hSFIMb4NWZnMfqmV5eelkgh Iqoqw+khqUx+uMxd7BBCHBfOlJwc4QPDNhcvBmoKNiZd0iSoABcG0LlioOcgrLbn7L9N 5hDbmeKekE5PyBJbz5faSRblKD0zcV4zDvyrNITcbU5wVlSRjMxqxhIT2JFnuHmznrpp hspxQJh2lSySzONINeLrREU89s9eFOGu6efmToV3s3haKHv+RSJVlOafMF9rGEjYDGZI yehSfSJUGnLDmVvHTsa+rXY8CYbKkGV4zT1iFkfrX7hRwWCLYXZhcGuVUv9abm3rZ+b4 zYcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701357054; x=1701961854; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=65x8xs7/Ug+eGRF3Q+RLiswQEr4hdxkkx4yPgUFKNFs=; b=P6rx2sc2tx6uXPgLSWFN+Rj+0USWtzIY3WrtTJFTDNS+3s6Dtw0apK1/2XPWxmyw5O YIcV8B4v8PJd6HPCQgejOrbpqmMtovAkoXFUzeB/JNMjwi7ztK8Uog8UN9qm05TNVTXS zAgXxTTzLZS+hWZ1TJD/pBZZsUtc1Fn4gOdyTDs7MSpxW8ENME0EagcLZ4slgg2oabv3 PE9Lw9cp1YNR36jINeio98KReUz/mGhX3dSHic8NIEeJoJtiXntvc/hNdT+S1rL2q6m0 lvS+VQ2TuLbCrdm51Rb3cFkCd2CwMV+rcWVIhv8VupwJdmljuDu1UUG9oJAzy9zAFFBw Couw== X-Gm-Message-State: AOJu0YyZLF2urgsWbkOCuIc/OcRiuj9s7B9RSWLbaj6IW9d9ZEgQgy7M xEGCgwnPyP/0ouCktbw9H4285PoYqxe36doWBRk= X-Received: by 2002:ad4:5f8d:0:b0:67a:2e8f:90cd with SMTP id jp13-20020ad45f8d000000b0067a2e8f90cdmr21597719qvb.37.1701357054019; Thu, 30 Nov 2023 07:10:54 -0800 (PST) MIME-Version: 1.0 References: <20231130135232.191320-1-marc.ferland@sonatest.com> <20231130135232.191320-5-marc.ferland@sonatest.com> In-Reply-To: From: Marc Ferland Date: Thu, 30 Nov 2023 10:10:41 -0500 Message-ID: Subject: Re: [PATCH v3 4/5] w1: ds2433: use the kernel bitmap implementation To: David Laight Cc: "krzysztof.kozlowski@linaro.org" , "gregkh@linuxfoundation.org" , "marc.ferland@sonatest.com" , "jeff.dagenais@gmail.com" , "rdunlap@infradead.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 30 Nov 2023 07:11:13 -0800 (PST) On Thu, Nov 30, 2023 at 9:52=E2=80=AFAM David Laight wrote: > > From: marc.ferland@gmail.com > > Sent: 30 November 2023 13:53 > > > > The ds2433 driver uses the 'validcrc' variable to mark out which pages > > have been successfully (crc is valid) retrieved from the eeprom and > > placed in the internal 'memory' buffer (see CONFIG_W1_SLAVE_DS2433_CRC)= . > > > > The current implementation assumes that the number of pages will never > > go beyond 32 pages (bit field is a u32). This is fine for the ds2433 > > since it only has 16 pages. > > > > Use a dynamically allocated bitmap so that we can support eeproms with > > more than 32 pages which is the case for the ds28ec20 (80 pages). > > Dynamically allocating seems excessive. > Why not just make the maximum a compile-time constant (say 96 or 128) > and just check that the actual size isn't too big. > > > As an added bonus, the code also gets easier on the eye. > > and slower :-) > Sounds reasonable to me. Thanks for the tip! Marc