From patchwork Tue Mar 28 00:06:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rix X-Patchwork-Id: 75746 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1875100vqo; Mon, 27 Mar 2023 17:20:58 -0700 (PDT) X-Google-Smtp-Source: AKy350ZzHoMtWnXhFpx6ejL4fKtIri5HUbag1G8byUUiK3GE/jdt6tkIDtWtjYaRq72tvCYlbpNT X-Received: by 2002:aa7:c9d6:0:b0:4f9:db7b:b6b4 with SMTP id i22-20020aa7c9d6000000b004f9db7bb6b4mr12210274edt.40.1679962858470; Mon, 27 Mar 2023 17:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679962858; cv=none; d=google.com; s=arc-20160816; b=Ynrj7GSeapMF0oTLdhpY8hzfaInDM3R+P631gaohbIii1mzArOB3fDbLibgwZ1uByQ TIxJCY70JedNjAPhV0KkqwTfLPwBV2A+QwREcP8KoQ/dZrWno89+ryv+h5vEkzL1lu4G vwTxU9ee48QfLZrYh+tKa1da6z48CYp05E+W4FAYBVcb2E396vdApDvbbzIKb4pKgqP9 Sq0DfJ4e5Ybw5HslXi6+Z/vaGpWFrH5p1nUiPk5dnJbTzAqa2dpW0vCm4vyACN+tnsfs oIyOea7AsVdiJZQbLHHwyQcEoiSByNmNhOLqM3RZFMPJ4kF/lLQoNTq3aZNErBTb1Snd YGAA== 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=oVSllWMtZWdtDUnZueS3ZITI6/5YaR00xl6fOWFPgxw=; b=vUKNxk/TKab3XgJeM0POr7jNuFBtWbDTM0lkJcIc5CSfExvP0hE5MTdlVgLr9dJWFv 0swezyjwol0/S4p8b6Mz+Zk9Pr2cKEfAXbOn/MOCu5QVdnBl66ZN2GvnHHzh190dj7cS mQHhFRop2qdfZkY1yyuXpA1lgy2esQg4l3ly8+kh1xz9AEsyX+FRGs6fWeGMC+miC5pL +6yWAeKQV4x1ZzDTcNZECJqyNn+9LdgIE8kM37UkIJtDgx/zWyy/bAcp9Nre02OCpQTr h4piTOX8Y2xh/zFP/LyEGtu5M7Myvk5BpBX8WRqRe3Pqge+vXWU7Pa4XzAgcerbsaxWK W1JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XnhdH8ww; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h4-20020aa7de04000000b00502038d273bsi11877100edv.575.2023.03.27.17.20.34; Mon, 27 Mar 2023 17:20:58 -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=@redhat.com header.s=mimecast20190719 header.b=XnhdH8ww; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230014AbjC1AHP (ORCPT + 99 others); Mon, 27 Mar 2023 20:07:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbjC1AHN (ORCPT ); Mon, 27 Mar 2023 20:07:13 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0436F1BC8 for ; Mon, 27 Mar 2023 17:06:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679961986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oVSllWMtZWdtDUnZueS3ZITI6/5YaR00xl6fOWFPgxw=; b=XnhdH8wwJKXFa2Kv6XMYVXTxhtjPrb4SOcz2AUjRDOqVP1qcDEB2F7yGo1qFl4kr3JtuqQ XvjP/qu2NKXYtAk+wy/9S62zH3iUNoSSDAgy1Gc1RaHb0CyLSxLDqv6ETDk2YikS0JaDhQ wLDGHHv7HT4ZR7sMnNfe66JMX1hacT4= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-16-KSeopUydNTuPObXxxmy_8g-1; Mon, 27 Mar 2023 20:06:24 -0400 X-MC-Unique: KSeopUydNTuPObXxxmy_8g-1 Received: by mail-qv1-f70.google.com with SMTP id l18-20020ad44bd2000000b005a9cf5f609eso4327074qvw.15 for ; Mon, 27 Mar 2023 17:06:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679961984; 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=oVSllWMtZWdtDUnZueS3ZITI6/5YaR00xl6fOWFPgxw=; b=S4OWcYJEKGuM8N7iBzpUYoI8glKWzoDDOvigVr7vbZBz3jPEFdADJX06x7WjYGvGvw H8AU4Rb0wNQj67GxU+T9PIvDKW8Bri2t5JwvH+cEdhIc8VNPmBZ6HWe7mxw+A56U95XC S9OhIajp9DBG/4qL7OWRuvOI10ulB4iyLGfKwip4LSlyoe+EbMdh+KmYZ/i3yyXNQ258 ehjqIjQSESZ2JxIZ1FXe+8diCNrc+bbUB+TA0mWZNiL2owUYTBYNq3O/zJvN6D6zQHyT PswsKDYSTolP4kGiq3kUijIttOx0bdJ0xnqSzkajIAAD4hSyjxz9CY/cImXPYr73QVJh arMQ== X-Gm-Message-State: AAQBX9e2PrlT6lJGFyZ67mWN09ZUXpdUB23qzW1Fns821XaKO8+YIjol WZM8jZck5OrXX45SYWYhthwN/1AW4AHZ6W8FQvnhL48He95zM/qihnPBrFr5NYKeoZqOcYu1qqi mDtQTqQQM9pfb9J6huS+aM7ns X-Received: by 2002:a05:6214:27cc:b0:5af:3a13:201f with SMTP id ge12-20020a05621427cc00b005af3a13201fmr20749281qvb.37.1679961984162; Mon, 27 Mar 2023 17:06:24 -0700 (PDT) X-Received: by 2002:a05:6214:27cc:b0:5af:3a13:201f with SMTP id ge12-20020a05621427cc00b005af3a13201fmr20749256qvb.37.1679961983880; Mon, 27 Mar 2023 17:06:23 -0700 (PDT) Received: from dell-per740-01.7a2m.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id q21-20020ac87355000000b003e387a2fbdfsm7130695qtp.0.2023.03.27.17.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 17:06:23 -0700 (PDT) From: Tom Rix To: miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, nathan@kernel.org, ndesaulniers@google.com Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Tom Rix Subject: [PATCH] mtd: lpddr_cmds: remove unused words variable Date: Mon, 27 Mar 2023 20:06:20 -0400 Message-Id: <20230328000620.1778033-1-trix@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761568733888370842?= X-GMAIL-MSGID: =?utf-8?q?1761568733888370842?= clang with W=1 reports drivers/mtd/lpddr/lpddr_cmds.c:409:31: error: variable 'words' set but not used [-Werror,-Wunused-but-set-variable] int ret, wbufsize, word_gap, words; ^ This variable is not used so remove it. Signed-off-by: Tom Rix --- drivers/mtd/lpddr/lpddr_cmds.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c index ee063baed136..3c3939bc2dad 100644 --- a/drivers/mtd/lpddr/lpddr_cmds.c +++ b/drivers/mtd/lpddr/lpddr_cmds.c @@ -406,7 +406,7 @@ static int do_write_buffer(struct map_info *map, struct flchip *chip, { struct lpddr_private *lpddr = map->fldrv_priv; map_word datum; - int ret, wbufsize, word_gap, words; + int ret, wbufsize, word_gap; const struct kvec *vec; unsigned long vec_seek; unsigned long prog_buf_ofs; @@ -421,10 +421,7 @@ static int do_write_buffer(struct map_info *map, struct flchip *chip, } /* Figure out the number of words to write */ word_gap = (-adr & (map_bankwidth(map)-1)); - words = (len - word_gap + map_bankwidth(map) - 1) / map_bankwidth(map); - if (!word_gap) { - words--; - } else { + if (word_gap) { word_gap = map_bankwidth(map) - word_gap; adr -= word_gap; datum = map_word_ff(map);