Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2162643ima; Mon, 22 Oct 2018 05:29:53 -0700 (PDT) X-Google-Smtp-Source: ACcGV63WbWI9xKRezbXHDSY0/8cTDnKimbzAnyZ3XDWWWAvtAXUEZlEFWCGWSwfzOb+u1v8zgkMy X-Received: by 2002:a62:2f44:: with SMTP id v65-v6mr36450565pfv.235.1540211393488; Mon, 22 Oct 2018 05:29:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540211393; cv=none; d=google.com; s=arc-20160816; b=wKEz+FYyLADNl8r4Mg7vyflmdjBsqV8wDxY1rQWytDIJSOaiLU7TJFLxbrXp5Hu0pG y4xmi4hdoWUIWjdQphJ0Pgk8hFsx3y6Ar1/4IP/hT8tS1ypw2qLJ2gyUcRtyTnweFLQD qluYGsXmJhPWOp9CznqvNHzvD9m7BBR1Em42UBVMiyQEfntCs395rRYfVlHglJWfWgcg RiY2I/pSQERMdtwL5/UQkpZI8HKJqjmJ3H8aCbDRyTOb3PgS2Fn4x+wx1B8CLteCoCbj KEw2cplrFpO5vj+fnhe1CZXX4X7e1smxRC5ztxZr/qZr2iT03mnRaUS6oPHJS64g2xJw qmOw== 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=Y/BnlWHspQYteyA1pf5FqDoV4U0ZykYAxjKcocIiNSE=; b=wofEGNWPTpcLXDrowyCb+xXBRE1x0rONb2qx+Qh8R24n2P6Qtx/YQGcOs8DcNREzUH HlBYCNrQsKXixFhRylJLo958KAGBjPr8uwaj1LciWY9+XAPPRlXZSOLVMPDdZt5gkeJX u3YCzFPl8K81rdMs5ohqv4DGiuyBaoSfc/eei6Sn93bqVXJmrfSVpqE3Zd/biG8/QdMn YDNpKkXttgd0LZVHc+EUjRjHNaxpJQYt4HllQZOZR0Zj7irskpvgFKEs3dk+PePi3xvc fMwkK8359HOrdCshyLsrpaU19AgJGcwKWbQz7tiA0tyDFVu1GWM6tLSJSbVoKTAqvH3w ZjTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FCM74EZp; 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 q9-v6si34695458pgi.162.2018.10.22.05.29.37; Mon, 22 Oct 2018 05:29:53 -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=FCM74EZp; 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 S1728938AbeJVU1j (ORCPT + 99 others); Mon, 22 Oct 2018 16:27:39 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:46744 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727194AbeJVU1j (ORCPT ); Mon, 22 Oct 2018 16:27:39 -0400 Received: by mail-pl1-f195.google.com with SMTP id bb7-v6so1491477plb.13; Mon, 22 Oct 2018 05:09:21 -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=Y/BnlWHspQYteyA1pf5FqDoV4U0ZykYAxjKcocIiNSE=; b=FCM74EZpw+G+B+G/Fyy4jWp8fmUe/XvXnJVpJ3i+QDtZmf686caf0flQqCafVKWvlN xAj7H0GNYXwfGk07SHFbFsciHeeQsMAk+AnbTC5KExz6M82CKk3A8JNTBSgkHH+iq5lz IFZDdj9xnPzlbdTjny7sFpDd19Ph3O5GVEkZ/VkivF5Kf5mYB8WOVRogvBXp9rXImvqx DXW5sEuYqQ5J7n3XWabVz43rpxaG8AYm6TPVASrcKMn3O8Uu1gFmTxlu4ciCkbKlkUsw jADLyAO6lA0jsJj30E1qvjdFGm1NEojxIdIiGMRp91SJFjjstykKCdKdmspWF5gWmtSz DTPg== 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=Y/BnlWHspQYteyA1pf5FqDoV4U0ZykYAxjKcocIiNSE=; b=udrFbwgCZ+ETdnC3IEJHckDjvzSrQw5pLyQP+hi7JZuRbWomtz8qslyUBzC9DiAYvU qZSvorIwZ7HvKIhSw5LS005YX7PJo9f9rBbykbiwCiI6g2SPK5ehGPv3uQpnW0WFbqSd QvcPPyzR0IwRbVs1s9pOqEpqIG6cIOZQ9GQpQfky8U7NrJtKyrRmLgcde7hUyd2H2VCD +eBIyp00g9pcVctGU5/vId21Zy1EbF/vHZQkzGFCRHJWU0lZFK5e0gjpQrwejs6/kYq0 vJNDk6S3YQC6NBGNXTPWCMjWg/pZpLJd8hcg1a0CN17Dd8VZBQUR/2UBpG4pBaOKns2o Io4g== X-Gm-Message-State: AGRZ1gJmCmHKb4jW3HbdMc8UeTdq1wcjPti1Us1++N0eiTIYVBNkb3yS 8kGXTj/pcGEZMQOT2qbqeEg= X-Received: by 2002:a17:902:b283:: with SMTP id u3-v6mr652720plr.123.1540210161531; Mon, 22 Oct 2018 05:09:21 -0700 (PDT) Received: from localhost.localdomain ([2001:268:c0a5:1904:c698:f9ce:cdd:454c]) by smtp.gmail.com with ESMTPSA id v189-v6sm41584937pfb.54.2018.10.22.05.09.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 05:09:21 -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 3/6] gpio: gpio-mm: Mask read inputs for get_multiple Date: Mon, 22 Oct 2018 21:09:31 +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-gpio-mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-gpio-mm.c b/drivers/gpio/gpio-gpio-mm.c index b56ff2efbf36..8c150fd68d9d 100644 --- a/drivers/gpio/gpio-gpio-mm.c +++ b/drivers/gpio/gpio-gpio-mm.c @@ -211,7 +211,7 @@ static int gpiomm_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask, port_state = inb(gpiommgpio->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