Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2877421ima; Mon, 22 Oct 2018 18:21:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV602TBAQRwM/AAAMza+d1JiCagoaXiIcdHEg9J7R7zsZsBNTWPtjcohlB3ig9XMkTKmjB9T8 X-Received: by 2002:a62:5ac6:: with SMTP id o189-v6mr48638060pfb.40.1540257697222; Mon, 22 Oct 2018 18:21:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540257697; cv=none; d=google.com; s=arc-20160816; b=wHOojBBqyQ/ecMa+QNrE808XzWGS6eR23bQA/7wKinhhLpFEDpAgXNsV4NBC3TX/lW 2QYwkKzjuSSPwRs8g/QO4hXlbCYWek17C0UoHPSF5POBs4HgdNePZ3PsQPRIMCQ+8vVs EGAH4i8s9C3RlIKJe4Fspa3XtYARlavFl83uzEUUi/IlP07stfhiOFVDM0g5butRpj0q iVrGBfQV5+EsdEe5QU4dMOulpcfvK3WKCRCKJvRbVuhpQRxwPaPR13yRjF/mPZDA/Q3a zI3keVqU5uSo4DZmpYGFISGpNpRYDdgTj+2CXPh/ybqpr1bbSx4b10Bh+BcyCxPwZH2K I2SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=8/8INH84dIZzXD9t1cfNjZHLAxNXXeBy6HCUhD39Vk4=; b=V+D6BZ9/1yQyGzT9TG30XZmJc3RahUfieIlxixaY+eZc8EtxhEIL/v2OG2CsZKZQKr F9kt8gPkYS0oRUzNt7BQwku3jIQSukrnaSz27uMKozsO1h70110eFBr13HQoDOWO4rQY BqlTFr/1B07CWZ5aOtdhYwS/4pU5oVqwb+AOGUTsGxEbSv9BW/5E608iW9ANwr6SalcZ 6ZCKB09TWT3jAm9zAmIqZsRLHEfviYed3uI4ZrK6nhoEvJWj/aRoR+dx5OViQyCsPvfp 2A9XLKNpreHg8jj4I00MTrk5D3TRWaC6XD5DPe3qUkhRcvk+sxVq3imNQatd25Mf/q6Q 1otg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RRysfJg4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n7-v6si35466066pgb.171.2018.10.22.18.21.22; Mon, 22 Oct 2018 18:21:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RRysfJg4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727773AbeJWJlj (ORCPT + 99 others); Tue, 23 Oct 2018 05:41:39 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:43926 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbeJWJlj (ORCPT ); Tue, 23 Oct 2018 05:41:39 -0400 Received: by mail-qt1-f193.google.com with SMTP id q41-v6so48717578qtq.10; Mon, 22 Oct 2018 18:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=8/8INH84dIZzXD9t1cfNjZHLAxNXXeBy6HCUhD39Vk4=; b=RRysfJg4oCtUMcUR4ATcTXH/GMpDTWfBaSwgKzdYEzUNwNrbjWf0vlklTAjfWd9tra v0HlFRCgVZGk6W6EWZbWaAlTP9UvTUVM0oFmvVy8h5694lqvqZwlxS41UYlCbrl3KU9j ZkrbRbbUJrcTx0ry++3B4trCU7rus2IE37iXQEgG9xjdDGnNTd/tstD7GMU3Rgl5A0XN UkPZh0EiS+rVjCKAn12u3ufwr9uhzlAeqipEkPZ9t1r9Qb3kHJgwX/X1UapIQwniFQ/l 3/C+F2BJdn1ottaBZqdFjCls62RouauctcF74HEckpkr2xoHaw9o62QsykRoa7emVT86 UxcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=8/8INH84dIZzXD9t1cfNjZHLAxNXXeBy6HCUhD39Vk4=; b=TaEMVhXLxFqqq+EJutaxt/b0hUT6FaUkp7WNCL5Sny+jcsNQJFe3krORwMQ2qNL2VB Ht55DRKxW7uaMsEcbPecTcRSBUZWVQwYWDtWJznXKud48ntmPeVQ68sPVAARTiApc13g g1n9PjOTUSkpKmN5MPYzg/qCNZFSun4+nfJ0hQ5CoOgNfKtAk2dcqWPSOEvZJLWFioGb 2LZqLiNZ7oc89Z8GQvjQIZpL5ExFvLB7ayHXX2lbjdRQFxZ1VPA75ecYQIvVkuWpqJjA crWYxr4h4yq174NtxEOviCYpDkf/Aei56XBuVEmrE62UX/+aVgz3+sY8MbqdBGJDJlfq LTOg== X-Gm-Message-State: ABuFfojU4MTR57/2rQiNl2u9R9G2xvck/1HJIVW8v5AaWGfPW+aO+bhU tbNL8+8KxPqasOQY7edgtcQ= X-Received: by 2002:ac8:3fb7:: with SMTP id d52-v6mr10667111qtk.46.1540257637071; Mon, 22 Oct 2018 18:20:37 -0700 (PDT) Received: from WindFlash ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id s21-v6sm7575288qth.11.2018.10.22.18.20.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Oct 2018 18:20:36 -0700 (PDT) Date: Mon, 22 Oct 2018 22:20:31 -0300 From: Leonardo =?utf-8?B?QnLDoXM=?= To: lkcamp@lists.libreplanetbr.org Cc: Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] Changes style to look more like list iteration. Message-ID: <20181023012031.GA6920@WindFlash> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes the code in order to make it looks more like its a list iteration. Signed-off-by: Leonardo BrĂ¡s --- It's a remainer from a patch from the -Wshadow patchset. Since it doesn't really belongs to that patchset anymore, I decided to release it just as a code refactor for file2alias.c I fixed it after Koike's suggestion (&&!dup added) IMHO it reads better this way, and no drastic change has been made. Thanks. --- scripts/mod/file2alias.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 3015c0bdecb2..b957279c4117 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -650,26 +650,26 @@ static void do_pnp_card_entries(void *symval, unsigned long size, device_id_check(mod->name, "pnp", size, id_size, symval); DEF_FIELD_ADDR(symval, pnp_card_device_id, devs); - typeof(devs) devs_last; + DEF_FIELD_ADDR_VAR(symval, pnp_card_device_id, devs, devs_aux); for (i = 0; i < count; i++) { unsigned int j; - devs_last = devs + i * id_size; + devs_aux = devs + i * id_size; for (j = 0; j < PNP_MAX_DEVICES; j++) { - const char *id = (char *)(*devs_last)[j].id; + const char *id = (char *)(*devs_aux)[j].id; int j2; int dup = 0; if (!id[0]) break; - /* find duplicate, already added value */ - while ((devs_last -= id_size) >= devs && !dup) { + /* find duplicate on previous devs*/ + while ((devs_aux -= id_size) >= devs && !dup) { for (j2 = 0; j2 < PNP_MAX_DEVICES; j2++) { const char *id2 = - (char *)(*devs_last)[j2].id; + (char *)(*devs_aux)[j2].id; if (!id2[0]) break; -- 2.19.1