Received: by 10.213.65.68 with SMTP id h4csp1742527imn; Sun, 1 Apr 2018 13:45:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+wGENx2lpLzfQvX1O1HZFJttmyhQFYrRE/eaX5bn9eNIZf2jaDiPKjjAtR05CEdM7+i2lu X-Received: by 2002:a17:902:b117:: with SMTP id q23-v6mr7338242plr.193.1522615539733; Sun, 01 Apr 2018 13:45:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522615539; cv=none; d=google.com; s=arc-20160816; b=zb+kGe/pzxWsK8nHp4lHFt0dHillBg76Pjplli8OOCvoRphPOnJNOe8xpaTQGJy0Uq HLcsX/vXQyxntCblCM1PFmYbuJjD4D/8LGOdkliD0ucCIUqyIcuEBNEf07bcJwHk/XCa PCIQpgaTpQ0o/KQEgthQsEwcpvXnZw0SwzOStGQM3imvTHtyJ5TL1JYrcBfCxakhPICo hp4dYyjMHWREq4S452GEY9rEiNp8YeXbf0acUraKi07W7jRDel5i5t6XdHurXNToZxRV foyNhYkAh9XluT1whA+lk6+TbJwYj0kH29pVz97z5NoRVVVbg8VnafsI2jg3PSYCfpqQ +sYg== 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 :user-agent:references:in-reply-to:message-id:date:to:from:subject :organization:arc-authentication-results; bh=nsQVAzmvkZpokuOiQtXed5nomCO0aaD7YSJuUb3B55c=; b=LlGc88fA9HdcjzwytMamisx2MDfkujSUSvwHPa//H+sZrH/JvDcng6LZxG6nH+UZ2K ZGeBTTQu3ng7pmMmAsgwpPDZfzq/Q3ODFF46/nD027pcU/qMZmn3Yc4FhHk5JrwM3vId mw7Y2zLQQrGDcNJekw+Qizx3SV2qAZ8C4IRfr9r5P3gVNyz71/zN8yxG2OzSNaE61J+O iWBpKDXGqfDZJY38gcZfY4XqUM+5I19vFyylzI2uSvJXDGpduC7WRZ17w7bASCmvETD5 a0H/6vJ5W9uPZl12qfDlozGhhWzXyZB9NFpHe3M8wPykGuBvlEWhz+NLjX4V89Dqgf35 /+1w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15-v6si7374812plp.266.2018.04.01.13.45.26; Sun, 01 Apr 2018 13:45:39 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754656AbeDAUoZ (ORCPT + 99 others); Sun, 1 Apr 2018 16:44:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43138 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754471AbeDAUoX (ORCPT ); Sun, 1 Apr 2018 16:44:23 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 78991406EA5A for ; Sun, 1 Apr 2018 20:44:22 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-59.rdu2.redhat.com [10.10.120.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 118361102E20; Sun, 1 Apr 2018 20:44:21 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 41/45] C++: Cast in bitops From: David Howells To: linux-kernel@vger.kernel.org Date: Sun, 01 Apr 2018 21:44:21 +0100 Message-ID: <152261546159.30503.11719145019451087798.stgit@warthog.procyon.org.uk> In-Reply-To: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> References: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 01 Apr 2018 20:44:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 01 Apr 2018 20:44:22 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the generic bitops functions, cast the void* bits pointer to unsigned long* before using it to avoid things like: include/asm-generic/bitops/le.h:15:28: error: invalid conversion from 'const void*' to 'const long unsigned int*' [-fpermissive] Signed-off-by: David Howells --- include/asm-generic/bitops/le.h | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h index 188d3eba3ace..8b0fb40da390 100644 --- a/include/asm-generic/bitops/le.h +++ b/include/asm-generic/bitops/le.h @@ -12,19 +12,19 @@ static inline unsigned long find_next_zero_bit_le(const void *addr, unsigned long size, unsigned long offset) { - return find_next_zero_bit(addr, size, offset); + return find_next_zero_bit(static_cast(addr), size, offset); } static inline unsigned long find_next_bit_le(const void *addr, unsigned long size, unsigned long offset) { - return find_next_bit(addr, size, offset); + return find_next_bit(static_cast(addr), size, offset); } static inline unsigned long find_first_zero_bit_le(const void *addr, unsigned long size) { - return find_first_zero_bit(addr, size); + return find_first_zero_bit(static_cast(addr), size); } #elif defined(__BIG_ENDIAN) @@ -52,47 +52,55 @@ extern unsigned long find_next_bit_le(const void *addr, static inline int test_bit_le(int nr, const void *addr) { - return test_bit(nr ^ BITOP_LE_SWIZZLE, addr); + return test_bit(nr ^ BITOP_LE_SWIZZLE, + static_cast(addr)); } static inline void set_bit_le(int nr, void *addr) { - set_bit(nr ^ BITOP_LE_SWIZZLE, addr); + set_bit(nr ^ BITOP_LE_SWIZZLE, static_cast(addr)); } static inline void clear_bit_le(int nr, void *addr) { - clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); + clear_bit(nr ^ BITOP_LE_SWIZZLE, + static_cast(addr)); } static inline void __set_bit_le(int nr, void *addr) { - __set_bit(nr ^ BITOP_LE_SWIZZLE, addr); + __set_bit(nr ^ BITOP_LE_SWIZZLE, + static_cast(addr)); } static inline void __clear_bit_le(int nr, void *addr) { - __clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); + __clear_bit(nr ^ BITOP_LE_SWIZZLE, + static_cast(addr)); } static inline int test_and_set_bit_le(int nr, void *addr) { - return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); + return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, + static_cast(addr)); } static inline int test_and_clear_bit_le(int nr, void *addr) { - return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); + return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, + static_cast(addr)); } static inline int __test_and_set_bit_le(int nr, void *addr) { - return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); + return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, + static_cast(addr)); } static inline int __test_and_clear_bit_le(int nr, void *addr) { - return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); + return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, + static_cast(addr)); } #endif /* _ASM_GENERIC_BITOPS_LE_H_ */