Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2213375ima; Mon, 22 Oct 2018 06:17:25 -0700 (PDT) X-Google-Smtp-Source: AJdET5cTayGDm6kIc0jByOWgoCiM36t0nq7PeLdroPZuLX0mTpzhF0Jwrq+6mmPtYY+Lrx040EES X-Received: by 2002:a17:902:be08:: with SMTP id r8-v6mr5948532pls.241.1540214245743; Mon, 22 Oct 2018 06:17:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540214245; cv=none; d=google.com; s=arc-20160816; b=uuqL3EFOalA2Phei9o+47tnVmCsqTujtBAy9L7OCy3BxOIpTEkVt3xVl/+OEFeRBxH NVdHnlnZvc8hyUqz7U4xFN/DvcmIEqjHvGPQxfYQz2fXGAO4gEZLlzHR+Uwc6iM5DnWA qdBDMmWMouFcQZBbVwugp3emt+qjyrgOWZeQJ3XHHEGZJKBbutceQKh1aKFcd/0fnIP2 wdA1DaMy1pYdBZCINYrJWS39xzvgNManiy1CObMcnVbf0dlxnUfBVxBVSPAh+0jzTobE NyZB4OyY3lb2Wrr/sCdcUPJPJaA6MGWI1VoaGNpUwQBkj2ZNU1OB0P6guSq9eVaHJeR2 35NQ== 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=j7MusjG4H6b2xIMWg4wOmTmbsUrzk81LRSqovr0t9o4=; b=VqxSAQXm3EplT8ZsYuiKNTY5LTrIMYH55rotfCptCECGb3Ek2KJYecVu9a7QdhbRNj VENvpmOWnBHgNFd/bUHGAt98y8Im9XBwQr2EoSXJqDX3ZBxh9YB0KalaK7JA4VLCNs7X Yeuz2sFPTTSrD1YKRgvjIzvgFKvRZgnFcR4p1JBK/kYf5D3oZk5K53NCfUlbuT64ZZ+D c1lwitA10tPfl7P6fVqXNgWzL/+RbE9MaTfzjrbk0DPsBM6bjvpgPgzRWBmD6OtWRabV Kw7X9Vf/d4jO5qtq7MbHSk5yZ07B1wq6OJClBCWm30JGtEXm9o+Iu05SlqtiVHM/HLk6 VErw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nwG8sOGR; 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 a71-v6si37674091pfa.109.2018.10.22.06.17.04; Mon, 22 Oct 2018 06:17:25 -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=nwG8sOGR; 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 S1728848AbeJVU1Y (ORCPT + 99 others); Mon, 22 Oct 2018 16:27:24 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:35356 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727194AbeJVU1X (ORCPT ); Mon, 22 Oct 2018 16:27:23 -0400 Received: by mail-pf1-f194.google.com with SMTP id l17-v6so19815473pff.2; Mon, 22 Oct 2018 05:09:06 -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=j7MusjG4H6b2xIMWg4wOmTmbsUrzk81LRSqovr0t9o4=; b=nwG8sOGRs95KXeDzgoBubkFS/kznqhQYkDgce0EdTSzzFh1jlUN/gaZIWMljC+WDSq dilvCcO3dPthcLY41ODGFrASqhALYLbddMVqm7tSMwPCv0ZFia6ujc8yZfpuwY4wqblI uzEd0bSuF4PNX2UYeH9nyD8ptwuX+9DCk60R2XZReeGa6eUMZaIfCuDg0wUq+p6qblSf k31+e0gnJbKHl4zCnzdDISHt1HWOK2Kme6ltHyLlWVLpIL0TIQA+3UCB+PhfaNM9uCuE OdP4mSQ2YVKYnDEu6ycDYb1XSo1q1F/nfkNjAHRkV13496qOOE1Z+aiqLdYyeD1bsZur T6fg== 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=j7MusjG4H6b2xIMWg4wOmTmbsUrzk81LRSqovr0t9o4=; b=saPGO9BXpi7jREXGvepfpvjy+v0DqJHCIfsGr04XdjNoJbiC95s+3JIgEPLIAQhF47 vkbx9Hmj60WGbY9ysaGJhwiXAsiqnTlD5Y6kmRc3hkxKvrpUV1er/eWQpUfsR4b+18TC sokQMTqjxZVzi14LNSLRexrNYaMMO4HMHfL1cAroa/IC+jnZF2SB7MQPhviKvzDGqLTF iD7FeVneaae67l6afHtOgxqKPVX5/uBgasmuZKd9kE76ueIPoFWL9v2gbWEe10Q4B7ZE 0KeqR+bI2QXLMs2fFBHqFjK+/P68Bs9BB8pt7ymBhrz69mAo6tLTsEHqJpoJDFfFl7Ev Y3qg== X-Gm-Message-State: ABuFfojCOMxiKdRTDIp8gqA8FNiGlMaacV/XZvK6y3+cv3PIjyx6mu4N 8X5FdQcmj6PuMV4oESGFfgw= X-Received: by 2002:a62:5a47:: with SMTP id o68-v6mr16308784pfb.31.1540210145814; Mon, 22 Oct 2018 05:09:05 -0700 (PDT) Received: from localhost.localdomain ([2001:268:c0a5:1904:c698:f9ce:cdd:454c]) by smtp.gmail.com with ESMTPSA id m74-v6sm64880572pfi.102.2018.10.22.05.09.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 05:09:05 -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 2/6] gpio: 104-idi-48e: Mask the read inputs for get_multiple Date: Mon, 22 Oct 2018 21:09:16 +0900 Message-Id: <7f7c7bb8dc10bb315ca03860cc24230bfc5370d8.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-104-idi-48.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-104-idi-48.c b/drivers/gpio/gpio-104-idi-48.c index 2c9738adb3a6..88dc6f2449f6 100644 --- a/drivers/gpio/gpio-104-idi-48.c +++ b/drivers/gpio/gpio-104-idi-48.c @@ -128,7 +128,7 @@ static int idi_48_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask, port_state = inb(idi48gpio->base + ports[i]); /* 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