From patchwork Sun Dec 6 09:42:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaoxiu Zeng X-Patchwork-Id: 7778401 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2C266BEEE1 for ; Sun, 6 Dec 2015 09:58:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E849203EC for ; Sun, 6 Dec 2015 09:58:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B152203E1 for ; Sun, 6 Dec 2015 09:58:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752328AbbLFJ6R (ORCPT ); Sun, 6 Dec 2015 04:58:17 -0500 Received: from mail-pa0-f67.google.com ([209.85.220.67]:34076 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751913AbbLFJ6Q (ORCPT ); Sun, 6 Dec 2015 04:58:16 -0500 Received: by pacfl14 with SMTP id fl14so14929876pac.1; Sun, 06 Dec 2015 01:58:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=m5MJEyhFngxrf3fiyO+SLFS2Z59CQPIWvYtQvGZ+Mzg=; b=wymKFl5ssUOMLf6hoAZyMfT1Owj98tPFmRrIWpE3snNwuutRpOmw3wsPORiKtXa2ly pZnNTM9/zT7WxYPeMecaHnZbvQ3Lp/tYWwYRFjDoAW9ZRKreQPkGXdzLH+L959mTsOUC hbyY+5twfEKHeZFsbJDLGQCP/WWW8pRbteWOS3egdXG/3GJwNg1hdWt8cQ9oWHM/u/YP FxfKA5f7U7O/hQwkU6Od7gkSc68Sd9LMzjrXrFtGQZInUlU63SO9ZDestZEXwZStZNZj xNpOgJIupK7bnFgGF7FqBszE6btkaRKi3uYnCie4ZKMZ8P9WndpHUi/votRabhwtvRsV CU7Q== X-Received: by 10.98.14.129 with SMTP id 1mr34769767pfo.161.1449395026986; Sun, 06 Dec 2015 01:43:46 -0800 (PST) Received: from fedora.localdomain ([223.73.7.158]) by smtp.gmail.com with ESMTPSA id cc16sm27533612pac.44.2015.12.06.01.43.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Dec 2015 01:43:45 -0800 (PST) From: Zhaoxiu Zeng To: linux-sh@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Zeng Zhaoxiu Subject: [PATCH 01/10] sh: Replace "hweight_long(flags) != 1" with "!is_power_of_2(flags)" Date: Sun, 6 Dec 2015 17:42:22 +0800 Message-Id: <1449394942-13964-1-git-send-email-zhaoxiu.zeng@gmail.com> X-Mailer: git-send-email 2.5.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- arch/sh/kernel/io_trapped.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c index f8ce362..d8f32bf 100644 --- a/arch/sh/kernel/io_trapped.c +++ b/arch/sh/kernel/io_trapped.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -62,7 +63,7 @@ int register_trapped_io(struct trapped_io *tiop) } /* support IORESOURCE_IO _or_ MEM, not both */ - if (hweight_long(flags) != 1) + if (!is_power_of_2(flags)) goto bad; n = len >> PAGE_SHIFT;