Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2164282ima; Mon, 22 Oct 2018 05:31:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV60qMpkYMPjuZ2DRqZa6f8EayMg2IO+grx14kDc8YVmJII/G3O3kQzp1VIuRBN3CkOG95oSJ X-Received: by 2002:a65:62d5:: with SMTP id m21-v6mr43468319pgv.243.1540211483338; Mon, 22 Oct 2018 05:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540211483; cv=none; d=google.com; s=arc-20160816; b=f+6N+fJiCBwb6DuYUMGGI8UR4hr2YKgMyOflQO8eSq2bZLKio08f5WRTdvEzq2AGjU q3HP2Ml3X9bsBCRxpCJ0oxJYzx9iODIrW54YOaZl+ActGhlSY+RNsYlWD/C17TzvCp1c KlkFtdfIgamfziWgJxgUjQJrmJJZk9qCGfPNVanzLBaf23mHQLn/oZMypx90CgmRX2ds bNDKhjxWafWws7CUZ4Eu9PD4dzZ/QkORahpL7pEWrsAgiU/6Ce6invZag6OTqg0ozFEV eEGnmvZ1/EaXNNE98THgxZQtkukUClYurfyM9TtkG/kQw3SAMOWVBLYHSNPLjP9ARNXR Z0jg== 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=GNkLkzZthpVuejMWcaYNvPopA/s2Vk8gtDQxxhr97GI=; b=z2JqU7xFopmA+FEtNTkR8pTjq49JqalxVC617lXkBobVXikC29n4mwk3l+RXAE7dpU kC2iKk8g88JYBOjQYnOtWN57nUiv4mZjF8m2qykkDjckJk4O2vfg5asmxpweLihARhSh vAQOOXqbz0tvAChoGvnMSOGy7Cig0vgPsgsOYL4Fiy3dKejpJkTov6xVqCwoVLoWnudZ Mcg9RaMMjT0L6ayfg3cYQR6awqG8LChhSvi7aLC1Np25tqXZ3blVUHfztlefWe1Kjh9X Utb304qtFe5GfsC/vaBQS1VjD+Uk1EZjSpREyJUibH/X63mef/Y+U/qWdNdI4SG6uz7Z O3Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Cpnqgo/N"; 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 a94-v6si36426189pla.123.2018.10.22.05.31.07; Mon, 22 Oct 2018 05:31:23 -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="Cpnqgo/N"; 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 S1728978AbeJVU2O (ORCPT + 99 others); Mon, 22 Oct 2018 16:28:14 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44622 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727194AbeJVU2N (ORCPT ); Mon, 22 Oct 2018 16:28:13 -0400 Received: by mail-pf1-f194.google.com with SMTP id r9-v6so19807587pff.11; Mon, 22 Oct 2018 05:09:55 -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=GNkLkzZthpVuejMWcaYNvPopA/s2Vk8gtDQxxhr97GI=; b=Cpnqgo/NCz2VZb9uaocLkw3+yQAOgRLKaaUnVWLle5K4pRQqqaPDJUaN4ZBc8I4QCJ TiFwe1vmbvLpTDDMowxY+koZa7xc891V2rY/pCXzAdEmVINPUUxp0mq1uAFHd3ySyOCC 9bOer/7RmAOGE63/UG71XGoM4jzeVz8aR07zhky2D2gzJYWfLIX3lN0MmJpCrmuCYPQN IymbNnUj6Sz7c3zXxpX4WHn/f7ericl1T834ntCaf+NgCIopQewnfBtGuAatoc1SLGaW Zc+br9dqsm/ZyNaf+zei1DmAzRfqjnfj9PBJswEZiBCZBlchqzl0shiGwhYhwQ3CdaGB Ebxg== 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=GNkLkzZthpVuejMWcaYNvPopA/s2Vk8gtDQxxhr97GI=; b=WiBL4H2TvUjQDqqGNjAE60nKnwtOERmDaVzKNmGMz/yXHpNWLSReXWpnq5JRLJ/EtL Tm6bDFHaoRjcmJ2pEY2IQ08hS5WZ6OoAjg/rz0fFASZEWoh4vrmsaQl7F2OzPNyftN18 OEtlfGDa+ycl45U7kgcHWmKNIT34AmCAw5RLz2A3GyKgPUOrKb5eDEDDNjxujU4FTza1 Pga+SnHAkC1yZa8yzDTHSHsEodk1B9z++hucOGz595DMEVH8EEl0USeCp2QcWilDjb9A pStPNGBg+Dj3yin0duMDZ9pNk3OJowiXjkQuWsT8JCCbJJNmHzLgDdQP0rJiZIL2USbm zszg== X-Gm-Message-State: ABuFfogY9snsR/y5YGc7yMjVXzPOpOIjvct+CsFyhySI3Qputpj7OzhB M1dCh0ghKG7buXAIBHg+JwM= X-Received: by 2002:a65:6249:: with SMTP id q9-v6mr42437631pgv.392.1540210195530; Mon, 22 Oct 2018 05:09:55 -0700 (PDT) Received: from localhost.localdomain ([2001:268:c0a5:1904:c698:f9ce:cdd:454c]) by smtp.gmail.com with ESMTPSA id w33-v6sm11572326pgl.29.2018.10.22.05.09.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 05:09:55 -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 5/6] gpio: pci-idio-16: Mask read inputs for get_multiple Date: Mon, 22 Oct 2018 21:10:06 +0900 Message-Id: <4e02f26b801f271e80b7738a851b52ab7ffde649.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-pci-idio-16.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-pci-idio-16.c b/drivers/gpio/gpio-pci-idio-16.c index 25d16b2af1c3..6b7349783223 100644 --- a/drivers/gpio/gpio-pci-idio-16.c +++ b/drivers/gpio/gpio-pci-idio-16.c @@ -146,7 +146,7 @@ static int idio_16_gpio_get_multiple(struct gpio_chip *chip, port_state = ioread8(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