Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2585603rwr; Fri, 21 Apr 2023 10:51:19 -0700 (PDT) X-Google-Smtp-Source: AKy350Y+JYDLKt7qNWzt1+BKuv4CvUVF7h09y7DppPt0rIoYlkQ9DOUrjEU3VwT+nQ3fYs5P3rEk X-Received: by 2002:a05:6a00:430b:b0:637:434a:75df with SMTP id cb11-20020a056a00430b00b00637434a75dfmr6557338pfb.0.1682099478783; Fri, 21 Apr 2023 10:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682099478; cv=none; d=google.com; s=arc-20160816; b=YtQ1pVqvkLEdYd5xD26Vbd76XlRXKUM3ErDNV3NSF+Sh/2+KqGf6GjzsTq6ckclHs7 R4AJ7S8Gt72rhFZRYxV1GJbTI6Nzw5t+kXurPkH3L+oAYitF/obPhoPyx2DabMwn15rI 0ZUm1dm1aoQatC6PIJc8EiF1jZHgg9L8ie+WANmTF1ZP4R3jXebo3MNkU6iA+enlnYhu Ad1teTmBFBaKD4CNIc5aiH7cqdJ5MCdZyrqxdFWIO33BaoZbUPhWXLrtfr9PZG+1O0Ug f+kwI9NCtdkUmhuw6aOqTwG5A3unw935xCNzy4ak/ATqyzQdQreg31FvZXYIfK/4gZ96 /W+Q== 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=DWqX2mo3dFEdJ7DitrYIS25Aemq6au0F4tIDpdUOsJw=; b=vL46rUio8VdPLjHqSY2fInayq09ARBC+B1qyteOCswR/ibsf/RkYO8VI1lFd6cPtMR 1XQ3M1hzIc603/iP2HOk3CrVwjN1EzAJ8ip9WezNqQC1sGRqWF6o+Hsqe+MuRK7sEAZ4 R+6JCxpVCpqDAPjhqB4LOx1er2kp9PaD5twF+HQHsn3Eiu4/UcfUeDtYbj3kJbp1E84E lgJy4Y1rvWUxxa2imnMyUVEHE78Lblb9FkLxJeXj5itUsKhIp68vn7nEV3r18PVNOCZp ESqFqr/379nPFok4VJlXYmDQTGFwlDsYKOd3bAu81ZQQY7lJEAeuPPdMUiZw505suELY TW8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=bfP6ECRJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 136-20020a62198e000000b0063d666566bbsi4739178pfz.299.2023.04.21.10.51.05; Fri, 21 Apr 2023 10:51:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=bfP6ECRJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232310AbjDURtM (ORCPT + 99 others); Fri, 21 Apr 2023 13:49:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233033AbjDURsy (ORCPT ); Fri, 21 Apr 2023 13:48:54 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 990841738 for ; Fri, 21 Apr 2023 10:48:29 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id 3f1490d57ef6-b8f557b241fso1050955276.0 for ; Fri, 21 Apr 2023 10:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682099309; x=1684691309; 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=DWqX2mo3dFEdJ7DitrYIS25Aemq6au0F4tIDpdUOsJw=; b=bfP6ECRJHhdI5t6m6waV6Qm4WcJC8DFhQCADYZFuc4ex288Vh8DWOzWAHUcjV1zhj+ oAy+Tv7CtzOmdM+/cz2ddJoxmDwNAD1p2+RdAnmYh1zr2l5ATaM8N8pdDsjOggdF1RM+ Z6v1SEuUrRPjusoKU0CtdgGIU8Qsuq0/awodvEN8pwdb0Kkk28brobkOOFtdq4gmPfSB lUWU51pzGRcvJEGmESaUaZ+SGaO5QHXeqEMwv+bBcwHSmQ66XF0I6o90axp1UVCrV6HU k8rgL9Lkds1KyFm8/Pmjk1wcXsGr7JXsV8XhBCrN0dIctyzqx8quROaQXrfAN4wqaKL9 rdZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682099309; x=1684691309; 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=DWqX2mo3dFEdJ7DitrYIS25Aemq6au0F4tIDpdUOsJw=; b=du42pZRZeRFlLFtUc/p1m3hSKwbPLT5yWy5GJqQEwtLRRuKzNPm5DW+nsqZbq7mEAy xBamuKyzfii9QMkb8grHmwWRt/7Ln291JRnSsDijAKaIWyAQPexnd5bNmEc5fVO15nvl R38Eka45AXCha2bgU9xpqUJHKAdm0suQRcIdZNQLW9NiEf167jNLGfGslrDgY2faQc2X 4JhSoCw+jBBzn6l6JAqbzXP6+R2GYrQ+okLVehHeFyxKFCSX2QWbFSJYz1QlcN/bYeGa SIeYHcKmd1XWqbHzlvcAiPbZtBLqZfQbOXmBckViEVbzTTjgfDEGEfJi8gJFO6uTyrcH NgZQ== X-Gm-Message-State: AAQBX9dtq1eAMltkC6YfXl5Yd60qU/sGNjG5Y60/d5U+CeqmMdqdZFnh VzDYTQGfgZEDOTRl7/VzFp4NJZbrt4HUGvQFfYO2CA== X-Received: by 2002:a0d:cc0d:0:b0:54e:e136:9f6b with SMTP id o13-20020a0dcc0d000000b0054ee1369f6bmr2554780ywd.46.1682099308692; Fri, 21 Apr 2023 10:48:28 -0700 (PDT) MIME-Version: 1.0 References: <20230420055131.2048959-1-joychakr@google.com> <20230420055131.2048959-6-joychakr@google.com> <20230421085354.34dwrgr3enlxqhtc@mobilestation> <969a083998224016947f5e77218f4587@AcuMS.aculab.com> <20230421164838.52euobr5ohfyxxti@mobilestation> <20230421171552.qvunrlxxpqusd5h3@mobilestation> In-Reply-To: <20230421171552.qvunrlxxpqusd5h3@mobilestation> From: Joy Chakraborty Date: Fri, 21 Apr 2023 23:18:16 +0530 Message-ID: Subject: Re: [PATCH v8 5/5] spi: dw: Round of n_bytes to power of 2 To: Serge Semin Cc: David Laight , Mark Brown , Andy Shevchenko , "linux-spi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "manugautam@google.com" , "rohitner@google.com" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 21, 2023 at 10:45=E2=80=AFPM Serge Semin wrote: > > On Fri, Apr 21, 2023 at 10:40:44PM +0530, Joy Chakraborty wrote: > > On Fri, Apr 21, 2023 at 10:18=E2=80=AFPM Serge Semin wrote: > > > > > > On Fri, Apr 21, 2023 at 04:39:30PM +0000, David Laight wrote: > > > > From: Joy Chakraborty > > > > > Sent: 21 April 2023 10:22 > > > > ... > > > > > Sure, I can make the following change in the formatting and send = the > > > > > patch series: > > > > > dws->n_bytes =3D > > > > > roundup_pow_of_two(DIV_ROUND_UP(transfer->bits_p= er_word, > > > > > BITS_PER_BYTE)); > > > > > > > > > > > Won't checkpatch bleat about that? > > > > > > Why would it? > > > > I ran checkpatch on this and it seems to be fine with minor spacing cha= nges. > > What spacing do you mean? No problem with the change as is: > [fancer@mobilestation] kernel $ git show HEAD | grep -A1 -B2 roundup_pow_= of_two > - dws->n_bytes =3D DIV_ROUND_UP(transfer->bits_per_word, BITS_PER_B= YTE); > + dws->n_bytes =3D > + roundup_pow_of_two(DIV_ROUND_UP(transfer->bits_per_word, > + BITS_PER_BYTE)); > [fancer@mobilestation] kernel $ ./scripts/checkpatch.pl --git HEAD > total: 0 errors, 0 warnings, 10 lines checked > > Commit e18b699257db ("spi: dw: Round of n_bytes to power of 2") has no ob= vious style problems and is ready for submission. > > -Serge(y) > Sorry for my error, it looks like my email client does not show it correctl= y. What I was going to upload in V9 is the same as you mentioned. Thanks Joy > > > > > > > > > > > > > Is it ever actually valid for the caller to provide a > > > > value that isn't 8, 16 or 32 ? > > > > > > Judging by this > > > https://elixir.bootlin.com/linux/v6.3-rc7/source/drivers/spi/spi.c#L3= 630 > > > it is. SPI-controller also supports word lengths within the > > > pre-synthesized range. So it's up to the SPI-peripherals and their > > > protocols what word length to select. > > > > > > -Serge(y) > > > > > > > > > > > I'm sure it looked as though some other lengths/counts > > > > where likely to go badly wrong. > > > > > > > > I know there are times when it is useful to bit-bang 'odd' > > > > numbers of bits - like command+address+delay for fast reads > > > > but that is a sub-32bit transfer so (at least somewhere) > > > > is 1 word but not all the bits. > > > > > > > > David > > > > > > > > - > > > > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keyne= s, MK1 1PT, UK > > > > Registration No: 1397386 (Wales)