Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2161423ima; Mon, 22 Oct 2018 05:28:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV62CTVV3dObzM0+x7P/RCuBUGNtK0AdI6ugyBMeegM42DRWIrSPfRvW5bn64SvOWoXcJWe/p X-Received: by 2002:a63:2b58:: with SMTP id r85-v6mr42100350pgr.432.1540211307440; Mon, 22 Oct 2018 05:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540211307; cv=none; d=google.com; s=arc-20160816; b=ZTjXL7iAJpz01ASJzZhfB0pe+5iC9fmNHYQ8fk0hslvP3MSgfF6MklK8W/DsldBZMC ikd+cLl3uqH2S9/h3zjFZulKd0k3ZE/w0/lcf7nQMBT9CO8FgrwLbTUHB+waAIUoiLRU z7IgTZ0nL3Y0VZE0je8bCVJJnB+HzjuKgNkqZ5wYoiCMNOUWqjzDvK3qwHePcyKG6LqW 21oeKIb0mvCfKaRKjpMp1tPlXUk88FR6FFyp2GFMGn+ExkIlKGtZCL6OBR6bFEIAFR9O z+UxZDY+yc8XVf616K9R2dpAb59YvY4JyHRLm47FFTrXEuS/FFVfwNpkKTSdqXT8mh08 Ef/w== 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=TNPWzi16BaQIPNRhNlYjjFyzyS4QT2S9QCHuJW2z5/s=; b=BNtOx/wMqLQQL3/w6aqW3hjA8HKyepHkczbt9odnej/fYnQIzdf39jlM9pMjMoaSKy 9ZY+ODUUktGAVvqS3UL1ah83lueQOdkFODYV8Nd3D7rt/+X354zUJvPrDGYBMf2HPrFD X2DQ7jCkdfTpzDrgh2tYE5bMVXLceqVAHY9JrMG9gaiFyUFaJvUOvqZFCcofws6CQQJw 2CCh7w8h8GckaXOKgNljzOU5b02EbhKpjnlyYeIbYKYsFH4tUdU07qXycLc5SJFwH4fY 1YKg48Ll6gKdKUMFjeJVByfVuyrwcaPJ6bE9+YaAc4PNHQarG8XzgeRZrHB72FUBwgeE orsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=st5nzmzv; 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 q1-v6si35316199pfb.258.2018.10.22.05.28.11; Mon, 22 Oct 2018 05:28:27 -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=st5nzmzv; 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 S1728712AbeJVU1J (ORCPT + 99 others); Mon, 22 Oct 2018 16:27:09 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:34443 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727194AbeJVU1J (ORCPT ); Mon, 22 Oct 2018 16:27:09 -0400 Received: by mail-pl1-f193.google.com with SMTP id f10-v6so1198347plr.1; Mon, 22 Oct 2018 05:08:51 -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=TNPWzi16BaQIPNRhNlYjjFyzyS4QT2S9QCHuJW2z5/s=; b=st5nzmzvAfSCHRG7hJ8jc1EymC/nTBauIlsmhUzE1sDbW0V5D/rJ6Ne/lsYT/BBTQn BOQKdN+XkH/hxtJbH/14Zw+vhsCGHaIxdQkreB1SSFbWt4OCRSdecM94+iYDbk2ena93 LBDLMske88TJ9QxO89R6uOxQN3Phk47L6pCUHHXux8j1uO5wiKtiidCWDGoeI+5br5ef Hpw9UfgLzcFyGgDydavM3yQHiS3EgF0azrqJCSueHwU/JA9e+b5Fe6KciELzABUnYsCu NExcwpUVSTtkRtYap+u0yfy2twHRbvJbeOJTAMXYtJjuIPJT9HGub6+eBiVNnBbullHf +2rg== 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=TNPWzi16BaQIPNRhNlYjjFyzyS4QT2S9QCHuJW2z5/s=; b=KZHRANxoEk2H8w8JaDamolJ59+1mGpwDFRdNrY+kc3rolB1DB3unaKoaNJ8ar6aeAD CD1zU1mHZ+6bss4MzW5rFfL+yLSFmqupz433gkJ3KI2wB+WjcpOpt7QCpsc81mgBbLBK hHyAIn0khnBfWClrKovOJAcAsVHFyfUtdxBmJjmk0vm7kb9mGz8hcdhrsReeRtS8YM1c J1chCUPyiRS684DNekoLbaXD83tUkaGjdZTdYqRhbhm7tjJMokyQgZbfE8gMlJQhCq9i VO314m2NAIIWj4vRQB7t6G4FwWFz90CV8CHI+xwBHK7i+he2GdliFHD3Ela7Tg7Y4Pcv PdzA== X-Gm-Message-State: AGRZ1gLvpoH4hNojcGvld71X1ge4D0gSNmxaMb7iGmtsvRCQw1dPHrAy FOdFvUu/HOdB06WIMrvTiqGO8O7x X-Received: by 2002:a17:902:748a:: with SMTP id h10-v6mr6888565pll.187.1540210131114; Mon, 22 Oct 2018 05:08:51 -0700 (PDT) Received: from localhost.localdomain ([2001:268:c0a5:1904:c698:f9ce:cdd:454c]) by smtp.gmail.com with ESMTPSA id k70-v6sm39081926pfc.76.2018.10.22.05.08.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 05:08:50 -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 1/6] gpio: 104-dio-48e: Mask read inputs for get_multiple Date: Mon, 22 Oct 2018 21:08:59 +0900 Message-Id: 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-dio-48e.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-104-dio-48e.c b/drivers/gpio/gpio-104-dio-48e.c index 9c4e07fcb74b..92c8f944bf64 100644 --- a/drivers/gpio/gpio-104-dio-48e.c +++ b/drivers/gpio/gpio-104-dio-48e.c @@ -222,7 +222,7 @@ static int dio48e_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask, port_state = inb(dio48egpio->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