Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp3036940rdb; Fri, 22 Sep 2023 16:32:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcjCaMdq2xEJWpFi/HV95yTMUWrrmVG/29qJXNXb2VBuNqaw/1APa1WnqVAsURXUkMiURG X-Received: by 2002:a05:6a00:17a0:b0:692:6d3f:4858 with SMTP id s32-20020a056a0017a000b006926d3f4858mr865160pfg.17.1695425532656; Fri, 22 Sep 2023 16:32:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695425532; cv=none; d=google.com; s=arc-20160816; b=UjiQcncE3nYO7CGlIfA/+tERn65JpLpRxsn5QAJh0ZCn8mIV7GThVK/H+qH3wYFO1M kPiXgIN2252YPL3BkwWSG67zdQT/ZHY76x8zsO6AHvTheFE+PcdvuQC+9sl5I2fzIgAs /sVA6wArmNUjl42KTR4bmW5u1Q+SNQW6oVHxBPXVZv2hASkBMbJdVE34bB+PYxXtK0Vf bg58YDuEGppahcy0eyVD6fLwPyzJwCUkZepKcpYNAn4GzFSaMsp9S1UrEsDuZt2R8deg SQADdIdOwOj9SQwyy565C3gyof711PR/i1Oobz14RCVF29FRhyRh4WazeLP1QC6PHSPL 9ukQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Tw3faLr6JrKkgEvs+aliRfwvgQoP/liBpAuWtI3CE6o=; fh=ZzWIIO90VkghLsuW4RL6vc4ttuuNMVm2zlly5CGg1Xk=; b=HSglj1oanfNis9IffkjZvAS/UpVJYpOWRpV38QV0kZ5kzuTH3Zne8GBDYO7A+EelNQ vL5ozYGvxkw7i/eo1+5Odz1KO0AW1oqlFUq3XIXepEAhwkHBfBKIE8AV1FomzQi9HTtJ zgMcUIuKSO6OtVLBOeKbkknn4Js8RaXM4wQ5n/2V5pEk/IWnaIVjqIegUHizaxeeBiEv CLhtCiFMqZGwUKXr8QOf5ubD2HGjRsaKW8KQFRSYHKaSzwUg7SkUq5gEf4BclPmPSwNl FX6lxgf5Winzid/ffWzO8aJoefsXx+WkBcPvwbwYZm97VOS2zRuwWAUPIzHx3sxCERMR pYcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wkennington-com.20230601.gappssmtp.com header.s=20230601 header.b=Wk8rVXvq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id v10-20020a63610a000000b0057c7341d562si2761840pgb.70.2023.09.22.16.32.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 16:32:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@wkennington-com.20230601.gappssmtp.com header.s=20230601 header.b=Wk8rVXvq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 33293823C106; Fri, 22 Sep 2023 11:28:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232377AbjIVS2c (ORCPT + 99 others); Fri, 22 Sep 2023 14:28:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbjIVS2a (ORCPT ); Fri, 22 Sep 2023 14:28:30 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CD2BCA for ; Fri, 22 Sep 2023 11:28:24 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-690ce3c55f1so2104095b3a.0 for ; Fri, 22 Sep 2023 11:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wkennington-com.20230601.gappssmtp.com; s=20230601; t=1695407303; x=1696012103; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Tw3faLr6JrKkgEvs+aliRfwvgQoP/liBpAuWtI3CE6o=; b=Wk8rVXvq99Tm2dqw8XG0mfraKIIlXSx1pHu7Cdu0/SGQSgs0ArDahroxgqKm+KoImz p4kw+bWzEiomnxXmQgqyjFetcUQj7SnCKwQuwWZR9TBy60zK2oT7lvlp9p0D4z26G3KN 7W/+dQ55ePJaMUZS2po4I2H4dZft/BT7HMqPgiSALiMPrFRTeTPXOGeZ/Dw2U0vUj+DC yqDygww/jGTr9aHWVXCBvRRZJOnbBaeABvKQo9KMZN+1kJI1ZI5bcd/FYiLsPlvc39aq vn3yy+YaTuUhwkcE8Lpzg0TBvJJFkzpZBYUGzDjVawxzR3hR7lAQaMSdUld1lIumiu/w DZkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695407303; x=1696012103; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Tw3faLr6JrKkgEvs+aliRfwvgQoP/liBpAuWtI3CE6o=; b=pd5BIWQO5ktPxrDGd40yo86JIiGI8h+3Zv9bM2bFpa4HW9WfRi+OzPcDMAwy2A9DCp 5eHwrgZgkfzNxP+k70oQs60G4OOufWMlN7+aATNQv/lZKDA7//rtNFXLuO8AnuahhVga RbTEPu82L+PiF+sA7Ucc2Ka+5a7ntFDVFY0iGqT/Ms8YXQplgWvAL7vA7+5h36r2mzcU XGDANjU/U3VUiqKICGJzLn6tbNu2vCCj5DL6hHSooPVzgvp/F0r25iHU4Y6Mn/0xQMJ1 C/tcIqijltlc15o+fojxnFgPH2AIflirj7FJtsbgCD6rF6vJ4wk16hl3zAf0ujuF6/dI p59g== X-Gm-Message-State: AOJu0YyXlmnw1+A3zR6QnQP5/rj0fLkRiDeJglOaQnH9myZMrbHnEYyy A+wUUjpE+L0eqbivzALIRuFJYA== X-Received: by 2002:a05:6a20:d406:b0:14c:c393:402d with SMTP id il6-20020a056a20d40600b0014cc393402dmr367890pzb.34.1695407303487; Fri, 22 Sep 2023 11:28:23 -0700 (PDT) Received: from wak-linux.svl.corp.google.com ([2620:15c:2a3:200:8efe:adee:187a:8f0e]) by smtp.gmail.com with ESMTPSA id fm1-20020a056a002f8100b00679a4b56e41sm3525816pfb.43.2023.09.22.11.28.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 11:28:22 -0700 (PDT) From: "William A. Kennington III" To: tmaimon77@gmail.com, tali.perry1@gmail.com, avifishman70@gmail.com, broonie@kernel.org, joel@jms.id.au Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, "William A. Kennington III" Subject: [PATCH] spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0 Date: Fri, 22 Sep 2023 11:28:12 -0700 Message-ID: <20230922182812.2728066-1-william@wkennington.com> X-Mailer: git-send-email 2.42.0.515.g380fc7ccd1-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 22 Sep 2023 11:28:32 -0700 (PDT) We don't want to use the value of ilog2(0) as dummy.buswidth is 0 when dummy.nbytes is 0. Since we have no dummy bytes, we don't need to configure the dummy byte bits per clock register value anyway. Signed-off-by: William A. Kennington III --- drivers/spi/spi-npcm-fiu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-npcm-fiu.c b/drivers/spi/spi-npcm-fiu.c index 0ca21ff0e9cc..e42248519688 100644 --- a/drivers/spi/spi-npcm-fiu.c +++ b/drivers/spi/spi-npcm-fiu.c @@ -353,8 +353,9 @@ static int npcm_fiu_uma_read(struct spi_mem *mem, uma_cfg |= ilog2(op->cmd.buswidth); uma_cfg |= ilog2(op->addr.buswidth) << NPCM_FIU_UMA_CFG_ADBPCK_SHIFT; - uma_cfg |= ilog2(op->dummy.buswidth) - << NPCM_FIU_UMA_CFG_DBPCK_SHIFT; + if (op->dummy.nbytes) + uma_cfg |= ilog2(op->dummy.buswidth) + << NPCM_FIU_UMA_CFG_DBPCK_SHIFT; uma_cfg |= ilog2(op->data.buswidth) << NPCM_FIU_UMA_CFG_RDBPCK_SHIFT; uma_cfg |= op->dummy.nbytes << NPCM_FIU_UMA_CFG_DBSIZ_SHIFT; -- 2.42.0.515.g380fc7ccd1-goog