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=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 DC805C432C3 for ; Fri, 15 Nov 2019 07:57:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B22BC2072D for ; Fri, 15 Nov 2019 07:57:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="BjHqHXiG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726980AbfKOH5H (ORCPT ); Fri, 15 Nov 2019 02:57:07 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:38592 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726182AbfKOH5H (ORCPT ); Fri, 15 Nov 2019 02:57:07 -0500 Received: by mail-lf1-f68.google.com with SMTP id q28so7291053lfa.5 for ; Thu, 14 Nov 2019 23:57:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zLHtq3yfrffU9o2nF0X7zoTmdgeT+a2HOFrUz+0J25Q=; b=BjHqHXiGMgpJVRBuo+lq+sEes/L+3Pgkfq4t22+sAm3ZkEfNZJjCgNxK0Lq2+SC82z q4IiSNGldEN1uq+0oO7YsbEQj/jG8NjDGr2TQGUPclpVxjdT+bLba2JJiXE7NvHKORtO xVd6o/D+7FumLWsNsyWQxMok7BRgJFk6bpv/4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zLHtq3yfrffU9o2nF0X7zoTmdgeT+a2HOFrUz+0J25Q=; b=VVaBVn6G0c/ImGFv58aLOhnrpymdreolbQbD+oZYjQDS4EQjkLdL0DCXHc39vybNN6 5b4vq91dG0b8oxctFGqfDIn+M/oX/uacrj5AyVr5z25KoLd1dHzbq6lZbrFVbT6mSVGv rnlz7ESpo6zYnCALRh0Jb++d8fV0c0p/qIC1Wjx/MPgdArCBsP3rL4koHCKNWTK4x0gd is6p3xv0GJa/zATe9uAqVnnvIaHaFdkWOQ+f4LhCmn6mVyBEuJA6b5HuVQ8sW4kVMX9Q 3zC6ZThjyq9S0cCpav6+1Jd1gFffpQ1Za2oDKR7bDHqSM1S+jYxKcXnATZfERmRqvRn5 M/Fw== X-Gm-Message-State: APjAAAUK6WO52B0nv3wx/YCZ2JyrJRgGLhmysexDv6mPNTDDrqUOtZdF noSeD+QH85iVKo8xVregaQCChQ== X-Google-Smtp-Source: APXvYqzS4mGv0Td6lhMx6P1LJw0rbb74jK3Vo5agUi9HiQO2P985F1jTJV8/p7ydSoDXjafwq0X1nQ== X-Received: by 2002:ac2:5236:: with SMTP id i22mr10287608lfl.19.1573804623889; Thu, 14 Nov 2019 23:57:03 -0800 (PST) Received: from [172.16.11.28] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id z21sm4888837lfg.0.2019.11.14.23.57.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Nov 2019 23:57:03 -0800 (PST) Subject: Re: [PATCH v4 32/47] serial: ucc_uart: use of_property_read_u32() in ucc_uart_probe() To: Timur Tabi Cc: Qiang Zhao , Li Yang , Christophe Leroy , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel , lkml , Scott Wood , linux-serial@vger.kernel.org References: <20191108130123.6839-1-linux@rasmusvillemoes.dk> <20191108130123.6839-33-linux@rasmusvillemoes.dk> From: Rasmus Villemoes Message-ID: Date: Fri, 15 Nov 2019 08:57:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/11/2019 05.25, Timur Tabi wrote: > On Fri, Nov 8, 2019 at 7:03 AM Rasmus Villemoes > wrote: >> >> + if (of_property_read_u32(np, "cell-index", &val) && >> + of_property_read_u32(np, "device-id", &val)) { > > I know that this is technically correct, but it's obfuscated IMHO. > 'val' is set correctly only when of_property_read_u32(...) is "false", > which is doubly-weird because of_property_read_u32(...) doesn't > actually return a boolean. > > I would rather you break this into two if-statements like the original code. > Sure, I can do that. 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=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 8BFAAC432C3 for ; Fri, 15 Nov 2019 07:59:17 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D30F2072D for ; Fri, 15 Nov 2019 07:59:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="BjHqHXiG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D30F2072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47DrN219CWzF6lJ for ; Fri, 15 Nov 2019 18:59:14 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=rasmusvillemoes.dk (client-ip=2a00:1450:4864:20::143; helo=mail-lf1-x143.google.com; envelope-from=linux@rasmusvillemoes.dk; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="BjHqHXiG"; dkim-atps=neutral Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47DrKb5Tx0zF5k0 for ; Fri, 15 Nov 2019 18:57:07 +1100 (AEDT) Received: by mail-lf1-x143.google.com with SMTP id r14so656540lff.3 for ; Thu, 14 Nov 2019 23:57:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zLHtq3yfrffU9o2nF0X7zoTmdgeT+a2HOFrUz+0J25Q=; b=BjHqHXiGMgpJVRBuo+lq+sEes/L+3Pgkfq4t22+sAm3ZkEfNZJjCgNxK0Lq2+SC82z q4IiSNGldEN1uq+0oO7YsbEQj/jG8NjDGr2TQGUPclpVxjdT+bLba2JJiXE7NvHKORtO xVd6o/D+7FumLWsNsyWQxMok7BRgJFk6bpv/4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zLHtq3yfrffU9o2nF0X7zoTmdgeT+a2HOFrUz+0J25Q=; b=LfPBnJNsjXLU7AWkplsPQRvEBJKz4XB2grH5tDqcm/Bi+3XodLJ8B7ldYhMkV7/wN8 r8TXVw8NZoUjLp9btWHLR1+zGT66LsLG9Vzy0hKJuzni+LvB9IcuNX0d6AZ1tfqHKY+N d84IUxS3l6OmrfNaNutBJMaEwRfdhA5bnXIO14P3n+jGMj93kx5OxG/dMX6eEva7qX63 QNNYLvZAz5dJn2V+0g8DntcGtH0SmoVwxfrIREhZi/EvV+3SefbPdbuLP2wRYJK0oXFs xh3jcvhiRYNrBy1CjgXuaPG6w7Os6Lp+jKZg6XVMhQ4riBuogIPfVS39A0xWn6T+Sb/O B9Mg== X-Gm-Message-State: APjAAAXZ/26vTyhF846wW8Naq843y5A2slMd2L/MJUqLGMtIZuIokEkM roJiDSyFnCjFxHXoucx7WVQanQ== X-Google-Smtp-Source: APXvYqzS4mGv0Td6lhMx6P1LJw0rbb74jK3Vo5agUi9HiQO2P985F1jTJV8/p7ydSoDXjafwq0X1nQ== X-Received: by 2002:ac2:5236:: with SMTP id i22mr10287608lfl.19.1573804623889; Thu, 14 Nov 2019 23:57:03 -0800 (PST) Received: from [172.16.11.28] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id z21sm4888837lfg.0.2019.11.14.23.57.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Nov 2019 23:57:03 -0800 (PST) Subject: Re: [PATCH v4 32/47] serial: ucc_uart: use of_property_read_u32() in ucc_uart_probe() To: Timur Tabi References: <20191108130123.6839-1-linux@rasmusvillemoes.dk> <20191108130123.6839-33-linux@rasmusvillemoes.dk> From: Rasmus Villemoes Message-ID: Date: Fri, 15 Nov 2019 08:57:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lkml , Li Yang , Scott Wood , linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel , Qiang Zhao Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 15/11/2019 05.25, Timur Tabi wrote: > On Fri, Nov 8, 2019 at 7:03 AM Rasmus Villemoes > wrote: >> >> + if (of_property_read_u32(np, "cell-index", &val) && >> + of_property_read_u32(np, "device-id", &val)) { > > I know that this is technically correct, but it's obfuscated IMHO. > 'val' is set correctly only when of_property_read_u32(...) is "false", > which is doubly-weird because of_property_read_u32(...) doesn't > actually return a boolean. > > I would rather you break this into two if-statements like the original code. > Sure, I can do that. 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=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 9E25EC43141 for ; Fri, 15 Nov 2019 07:57:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 74FFA2072D for ; Fri, 15 Nov 2019 07:57:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GJmKtMVl"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="BjHqHXiG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74FFA2072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DhuS/GlxKMtx/BTyfXghElnz2+yW06M4PxS8iFlAGAk=; b=GJmKtMVlwmDHhP A+wh308pX0tTltdsj9vlYlMlA6EGEzLnNCgS6QWBPLAkPMt6d7+1M+dDHdnqZEc6BSAhaVbrJuxAY 36mGx4dknswLkhZ9QW9Z3/JF5dtzRFlIGRozs1ZJvNB5vlTjgUlylwBzgH1mQDJnh0m0ZhLAgmfi/ A5KAicZWEMHRIoO7y/MyZpOCaeBQZYeT4S1s0/ewEaN5adz2HhaqTFwMHurwHH/2LKVoJf+L01ZLN 48BcfD3vmMEEC6+PB1ID6SRmc5MdoxVTFkRgdUaqpIs4oUjGCmT6qb91aA7RxYy7NX4WrkTecQZi9 +/gxJ6DesQCvop/Zkvrg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVWTd-0006Wn-02; Fri, 15 Nov 2019 07:57:09 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVWTZ-0006WT-Pg for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 07:57:07 +0000 Received: by mail-lf1-x142.google.com with SMTP id z12so7275029lfj.9 for ; Thu, 14 Nov 2019 23:57:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zLHtq3yfrffU9o2nF0X7zoTmdgeT+a2HOFrUz+0J25Q=; b=BjHqHXiGMgpJVRBuo+lq+sEes/L+3Pgkfq4t22+sAm3ZkEfNZJjCgNxK0Lq2+SC82z q4IiSNGldEN1uq+0oO7YsbEQj/jG8NjDGr2TQGUPclpVxjdT+bLba2JJiXE7NvHKORtO xVd6o/D+7FumLWsNsyWQxMok7BRgJFk6bpv/4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zLHtq3yfrffU9o2nF0X7zoTmdgeT+a2HOFrUz+0J25Q=; b=UbYgPZD9m8NakDyKrE2vvRDHcPysYkTol5kbRZlpG9oDJh3Rd7mn0rSdjghf0sUyM/ obmrG9Gjulqvs5lrGJDeHvqWZCAeIx5d99Q01wY6Y4Nxkggm2CgNyxyvo1FwBVBtuh7e sYH5PXWri7whHPnCE6IcB7JhyjRkEutVRCf3GkcB6r4uVwuTK5nLs+bVU7cQDoUNyBiQ ihN+/xTilDpQNjypUu7mLueL4+EeOM4FBLeiyD9tsPLPGlmFqqkeDeMcifhao8Nw39lE hX5aEAny6lWqk9hzY5gwyQXNB/+NtsTJyJ3bPjSrmFGptmXZDe67WosdfBKZHzWrio+x 43DQ== X-Gm-Message-State: APjAAAV5SmlL/f9ZUwSPuFRdx0sbFDSB/EVG60Exx/QdKqtJ14TCIkqx I3XT8tw+ttUfHJRyR0EDnq2gbA== X-Google-Smtp-Source: APXvYqzS4mGv0Td6lhMx6P1LJw0rbb74jK3Vo5agUi9HiQO2P985F1jTJV8/p7ydSoDXjafwq0X1nQ== X-Received: by 2002:ac2:5236:: with SMTP id i22mr10287608lfl.19.1573804623889; Thu, 14 Nov 2019 23:57:03 -0800 (PST) Received: from [172.16.11.28] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id z21sm4888837lfg.0.2019.11.14.23.57.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Nov 2019 23:57:03 -0800 (PST) Subject: Re: [PATCH v4 32/47] serial: ucc_uart: use of_property_read_u32() in ucc_uart_probe() To: Timur Tabi References: <20191108130123.6839-1-linux@rasmusvillemoes.dk> <20191108130123.6839-33-linux@rasmusvillemoes.dk> From: Rasmus Villemoes Message-ID: Date: Fri, 15 Nov 2019 08:57:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191114_235705_833290_DBC43AA8 X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christophe Leroy , lkml , Li Yang , Scott Wood , linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel , Qiang Zhao Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 15/11/2019 05.25, Timur Tabi wrote: > On Fri, Nov 8, 2019 at 7:03 AM Rasmus Villemoes > wrote: >> >> + if (of_property_read_u32(np, "cell-index", &val) && >> + of_property_read_u32(np, "device-id", &val)) { > > I know that this is technically correct, but it's obfuscated IMHO. > 'val' is set correctly only when of_property_read_u32(...) is "false", > which is doubly-weird because of_property_read_u32(...) doesn't > actually return a boolean. > > I would rather you break this into two if-statements like the original code. > Sure, I can do that. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel