Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2214334ima; Mon, 22 Oct 2018 06:18:22 -0700 (PDT) X-Google-Smtp-Source: ACcGV62RzfL9chDEJ+NR9sKEZjtbuk4YVIKHtIopHfOpmf7JvyrzwvabzSFcg+KrAKUrO++xHYea X-Received: by 2002:a17:902:7613:: with SMTP id k19-v6mr13401644pll.98.1540214302488; Mon, 22 Oct 2018 06:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540214302; cv=none; d=google.com; s=arc-20160816; b=znM7R2pdVPj7EEVe/paqBIi3VY+X/kcStwtBvZ5PshhnAZJL4xGHiHmuykq3JFBObH /TD2agCKtLfwItca2JiG3XsRq296OKaIESJrXgEp7vR16RxZzQXGWugGvcm2mJak7cPw UH2PxSloynIwZY73jGEgvNsq3xFPfyvrzXD6oU+v/Tnx4E7vsAKmjQNaa0xGL8o7OmRt hBcAVCqcrWrUqi84m8EuzVEMWXbud9Rozuvnva+fOAPHoqFrCe2GNS6nEnvH2XGW85IC 9mlN+Q66inXZbgJqTwiIfoH2kbSLbtxV+R+Iam2rjtMizyoIb8riBM3ob4ETPJTGKqTr ONWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eI7jyCscghMFVwi5rRdpET+OM09C3fZ24B1HB+ARyNE=; b=vbZrmvflhfNcuOYrywnsbvoNmuStmEAE9H6h71Yqnkwn8c6CZIR5BMSPBHLAB+q9IZ qwmDQFUZfRa5FpNFQEThByzoXZC2OXbwaemuoWokTZctprVFSDvLhxeLYDf+FGNvqAZX m4O5SC+fiE8W5AcpWzHupMTZy1PNhetX0ecZ441b6BwYZsCtf/cy5o0ug2Hxdkcua6Lp ZMcPplB3YPQP24xRarmf4Fwabnc6qgcxCtv2yHyOaIlxjEzStxRub9g0rnCM7tYRT7mo rxGa7+B0AlU1GdJZJCvO1VsEIiZuexlDJsH/qWb234jZFxRBfvxP/dbxoscpNo2/xAJP F1NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UNwQnGFs; 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 a16-v6si31527855pgw.187.2018.10.22.06.17.58; Mon, 22 Oct 2018 06:18:22 -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=UNwQnGFs; 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 S1729039AbeJVU22 (ORCPT + 99 others); Mon, 22 Oct 2018 16:28:28 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:35409 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727194AbeJVU21 (ORCPT ); Mon, 22 Oct 2018 16:28:27 -0400 Received: by mail-pg1-f194.google.com with SMTP id 32-v6so7755496pgu.2; Mon, 22 Oct 2018 05:10:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eI7jyCscghMFVwi5rRdpET+OM09C3fZ24B1HB+ARyNE=; b=UNwQnGFsQEA6hnmfX2Z61OVHTk6czkWW3V3Mx4NoUJ0SgjgaKClFBn6sIjZG6+IA+b /M9vjeh/wxk8upLA7M9Vwnp2aMkpbhvI65LlK8/oTjAxsAswRO7JIadQZR296pNI03Zo FP6NSRDJs3U8y5NxQpgLzTJ1m74nAONmVzSayjvQD+Ea53gRBB6vzVOnxgcdQMtJBNO0 8OXLiIbNnBK4AWf2XrDarthvX9Gh50+xfZP7m5PJ+w7j5dYfrpXr5r5j5iLTO4R/KlnQ C3nFYBmsg431DSH13RYJE4Aquf68ri3O3vGgWoYqyMkuXXJ6/60S0HUEsryJ+TtUmdho eiEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eI7jyCscghMFVwi5rRdpET+OM09C3fZ24B1HB+ARyNE=; b=NfEbOtb21jilajOjrGeo+QDy4MiTkrGRerYdjiG6OOecedJErWjrbtQEeef9Gs9+KQ px4sXlNla8nC44zOe0tHa4l8FdvlGKKD8rj79rWQQIB5QH2YSO3BJMhyXF+ecc9s/akw DaWKbHRBesbklPtYG9/Vd3iPaESeAU09Fh/yw6xLY3bKZoiYXNXrmJHFYZW/4P5/c0z9 84jLFjuLKOBMmoeQw0MVCPgPCmpsji6xhIEx4rVOC7zR/DjtotEp9Mh6yebf0r7zIVtI hilli3fYPZsiYtf/BmNX176MKrD9doAiaZAqtbVw2E2JdKcVige5/h0fpgq6wFjwbHVO llXA== X-Gm-Message-State: ABuFfojhxNXy6xTa3eUpZAfvZk8e6+HIArTO1fNLhgmRYg6jAvJhD4Xc wgMR90BSLiTFwUGk+qctV9Q= X-Received: by 2002:a63:4952:: with SMTP id y18-v6mr42594111pgk.32.1540210209171; Mon, 22 Oct 2018 05:10:09 -0700 (PDT) Received: from localhost.localdomain ([2001:268:c0a5:1904:c698:f9ce:cdd:454c]) by smtp.gmail.com with ESMTPSA id b14-v6sm38033147pgn.49.2018.10.22.05.10.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 05:10:08 -0700 (PDT) From: William Breathitt Gray To: linus.walleij@linaro.org Cc: linux@rasmusvillemoes.dk, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, William Breathitt Gray Subject: [PATCH 6/6] gpio: pcie-idio-24: Mask read inputs for get_multiple Date: Mon, 22 Oct 2018 21:10:20 +0900 Message-Id: <820f8297d25932ba9dad2dfb50ceee3f803f83cc.1540209293.git.vilhelm.gray@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch masks the read inputs with the word mask in order to ensure only requested input states are returned in the bits array. Suggested-by: Rasmus Villemoes Signed-off-by: William Breathitt Gray --- drivers/gpio/gpio-pcie-idio-24.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-pcie-idio-24.c b/drivers/gpio/gpio-pcie-idio-24.c index f953541e7890..52f1647a46fd 100644 --- a/drivers/gpio/gpio-pcie-idio-24.c +++ b/drivers/gpio/gpio-pcie-idio-24.c @@ -243,7 +243,7 @@ static int idio_24_gpio_get_multiple(struct gpio_chip *chip, port_state = ioread8(&idio24gpio->reg->ttl_in0_7); /* store acquired bits at respective bits array offset */ - bits[word_index] |= port_state << word_offset; + bits[word_index] |= (port_state << word_offset) & word_mask; } return 0; -- 2.19.1