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=-4.0 required=3.0 tests=BAYES_00, 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 5C91CC433DF for ; Tue, 14 Jul 2020 02:21:38 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (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 282AE2073E for ; Tue, 14 Jul 2020 02:21:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 282AE2073E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1jvAZR-0001Jb-6W; Mon, 13 Jul 2020 22:21:25 -0400 Received: from omr2.cc.ipv6.vt.edu ([2607:b400:92:8400:0:33:fb76:806e] helo=omr2.cc.vt.edu) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1jvAZP-0001JW-2a for kernelnewbies@kernelnewbies.org; Mon, 13 Jul 2020 22:21:23 -0400 Received: from mr4.cc.vt.edu (mr4.cc.vt.edu [IPv6:2607:b400:92:8300:0:7b:e2b1:6a29]) by omr2.cc.vt.edu (8.14.4/8.14.4) with ESMTP id 06E2LMZx028331 for ; Mon, 13 Jul 2020 22:21:22 -0400 Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by mr4.cc.vt.edu (8.14.7/8.14.7) with ESMTP id 06E2LH02030861 for ; Mon, 13 Jul 2020 22:21:22 -0400 Received: by mail-qv1-f70.google.com with SMTP id m8so8647831qvv.10 for ; Mon, 13 Jul 2020 19:21:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=0VApuAWXSSuNH76vm/X1CQ0hMkgKdQcCJ9SDmVFZS3k=; b=hkQXIus36dluaJb+RZvZ9+ewWZPDY+E77/BGw685tm97Hoot6YPAdFF2WndcR8wJRt abIwWyQ16vhEUa8rb6QNpKcr9kbqccMZlKhU0OHSYSp4vGJ5AhTwnqymJWakBUJz/J1K v4BuD674UkG5IHVH0b0ZEOM/+f1+FvllTqBi/bM8RWEWVkI3CNudlxlmqXYdRzhcQSh6 WrgpALF9fajtKLfu/lui+uvBAC1T2UYr0etYA4dcjJru7F0HJphIKuDOMiIwxus937/J DHOS4YCOxP+8d4fhM3Xt+u1C6Mm9YSgaZVK2XZRsz9yLfh4ZhEu3tUjR9XwtQ7qyBDbC Obhg== X-Gm-Message-State: AOAM533/ujp/xs2U9kLXmz0kv+b1W11Xz0zM2bPkFPs4Wqq1g0EHxRlw o6/OiwCKtcoO1quYFpq14wy/cb+vtpleBFUY4RD9oZdd6qfize0okOZPKpMlNv3+PRushvX++Dm 0HGVSmFf/Svm87hwOCVPHba66ecLRA5DMfmfF4nQ= X-Received: by 2002:a05:620a:564:: with SMTP id p4mr2525699qkp.204.1594693276976; Mon, 13 Jul 2020 19:21:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCFa7D1TXCk9w9YPNqEHmoRqFe15oBGBp2cysjBzIk9EOKg5qmJHbO1OwHf6AOhs7O3N+BOQ== X-Received: by 2002:a05:620a:564:: with SMTP id p4mr2525680qkp.204.1594693276510; Mon, 13 Jul 2020 19:21:16 -0700 (PDT) Received: from turing-police ([2601:5c0:c001:c9e1::359]) by smtp.gmail.com with ESMTPSA id a185sm20109177qkg.3.2020.07.13.19.21.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 19:21:14 -0700 (PDT) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: carver Subject: Re: How to understand the comment of macro *compute_indices*? In-Reply-To: References: Mime-Version: 1.0 Date: Mon, 13 Jul 2020 22:21:13 -0400 Message-ID: <431735.1594693273@turing-police> Cc: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============5263941477049113519==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============5263941477049113519== Content-Type: multipart/signed; boundary="==_Exmh_1594693273_174210P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1594693273_174210P Content-Type: text/plain; charset=us-ascii On Tue, 14 Jul 2020 07:54:04 +0800, carver said: > Hello, > > Macro *compute_indices* in arch/arm64/kernel/head.S have a comment > as shown below: > mov \istart, \ptrs > mul \istart, \istart, \count > add \iend, \iend, \istart // iend += (count - 1) * ptrs > > I am wondering whether this comment should be change to > "iend += count * ptrs". Examine the uses of the macro, and see where they expect the result to be pointing if there is exactly one entry. (Hint - what's the address of the first entry of a C array, and what's the next location after the array, and how would the corresponding C code for iterating across the array have as the termination condition?) --==_Exmh_1594693273_174210P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQIVAwUBXw0WmQdmEQWDXROgAQJEDRAAjWUet69QsiC+WR4kS1xbHjl6T52nznRT /bsEIQjQNZidbTbm9OuQZa6JURf4dh0NtJlqJOo3duX+345v+yewG+1bM9Bvteon lYEa1Q42+wfsEKNf8nT8LIHJeJb/reaBUs9DWc8NKoVu6PRtHj52krKrNCc3J570 8GKWrJGmK7TUAlZrjuJ80ZWxCBEb0AvOEEWwDQYfr2YFaiVHIb3buZzjeznqzKqO q0WKxpJ3KrEIeBjuYPojRpmQMxpDU39SN9MoZyMBVuUtZ7l39fd7sIstGa0f3jSA j4y7OBcFgfPTocziUiUB+sxjMWN2vbiL7CpCoZEQKNXBHX+eqba5vGPuQWNaNVUu idoiNKeccM+OFTaj7blNPx8+5uOxXdR4G8A6jYw4Uc/tMf6YCOvaq/IHk01AbQAm sTyXY7f9xVMovvRam/osHOCpT7wu0CAsBKaNt7UmvaGJavWwMt9J6QF7//aTmt43 7FMoVPlUFSh/ZYRm0yY613xLouY3Y7W2cYMxlNGXwDevNToy3HtQQ+4s9hu5wQ1e +yvwjkvB0ofl0g9RNRvwKrXiiXKQ3++P4wucmd8rz4Xg1GauVcXZ0fwY7AIXqK/x T/iv7fkG8T7lu0S0znCPd9yfJMbfHJewguyivlhgjq13glGKKNntYYw10lf54dfo FFg6JHIy+ks= =dSC4 -----END PGP SIGNATURE----- --==_Exmh_1594693273_174210P-- --===============5263941477049113519== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============5263941477049113519==--