From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00C97C282DE for ; Thu, 23 May 2019 19:39:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C32F420881 for ; Thu, 23 May 2019 19:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558640375; bh=Tug76pgDYIbZKlAuIYBUdQn50+xAQzKdh/iY3Kfv408=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TvtAcDbOozfhtaGbb1K7sWAqS+1yC5HrkP6Gx8koRdl/C5iy/z5hafj/DdWKRn+T5 oZeQ1HiWsHuVBG8U+XHyKZVVw1PXAc2YVDw3vY/DnK5vFTI09OwoOASC421OUD3ih0 kc9mCcf1bST+bXk6P1tFVFJrbWuNZNy4UAtJmNVg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390375AbfEWTWA (ORCPT ); Thu, 23 May 2019 15:22:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:59372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388660AbfEWTVu (ORCPT ); Thu, 23 May 2019 15:21:50 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2C0E5217D9; Thu, 23 May 2019 19:21:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558639309; bh=Tug76pgDYIbZKlAuIYBUdQn50+xAQzKdh/iY3Kfv408=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NH/01Dbbd0IYeowv6E7l9TUm2/SodjL0R+OPUcibegs3qD9IeCoZI8L/RX+SCMFVD mrtuF9cT/ED9KmFCYGMcWvzi5TyoUaTChzltXsOWr5HgFlMiuehDeZ0f+hvHqPXOL2 NwnJcaQDrDdiDfBO72Z8hREEDawe0mcRl6tfqQOo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Phong Tran , Nick Desaulniers , David Laight , Rob Herring Subject: [PATCH 5.0 040/139] of: fix clang -Wunsequenced for be32_to_cpu() Date: Thu, 23 May 2019 21:05:28 +0200 Message-Id: <20190523181725.972727749@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181720.120897565@linuxfoundation.org> References: <20190523181720.120897565@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Phong Tran commit 440868661f36071886ed360d91de83bd67c73b4f upstream. Now, make the loop explicit to avoid clang warning. ./include/linux/of.h:238:37: warning: multiple unsequenced modifications to 'cell' [-Wunsequenced] r = (r << 32) | be32_to_cpu(*(cell++)); ^~ ./include/linux/byteorder/generic.h:95:21: note: expanded from macro 'be32_to_cpu' ^ ./include/uapi/linux/byteorder/little_endian.h:40:59: note: expanded from macro '__be32_to_cpu' ^ ./include/uapi/linux/swab.h:118:21: note: expanded from macro '__swab32' ___constant_swab32(x) : \ ^ ./include/uapi/linux/swab.h:18:12: note: expanded from macro '___constant_swab32' (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \ ^ Signed-off-by: Phong Tran Reported-by: Nick Desaulniers Link: https://github.com/ClangBuiltLinux/linux/issues/460 Suggested-by: David Laight Reviewed-by: Nick Desaulniers Cc: stable@vger.kernel.org [robh: fix up whitespace] Signed-off-by: Rob Herring Signed-off-by: Greg Kroah-Hartman --- include/linux/of.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/include/linux/of.h +++ b/include/linux/of.h @@ -234,8 +234,8 @@ extern struct device_node *of_find_all_n static inline u64 of_read_number(const __be32 *cell, int size) { u64 r = 0; - while (size--) - r = (r << 32) | be32_to_cpu(*(cell++)); + for (; size--; cell++) + r = (r << 32) | be32_to_cpu(*cell); return r; }