Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2926414ybc; Thu, 14 Nov 2019 01:03:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzLpJ1THhik+WkaJTe488bc0B0onTUPmEiWuDHPJ5U7ciligratg8Rr2sPtlv8Mf782/6OC X-Received: by 2002:aa7:d295:: with SMTP id w21mr8556614edq.13.1573722223329; Thu, 14 Nov 2019 01:03:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573722223; cv=none; d=google.com; s=arc-20160816; b=IbVyjuZoDeGPdY4mtgrkU1iTTsvqzTsV4TwznKS1UlVL9IX+sZpD/UZsGa8Aa+5Ta1 0pRFB8/YGXlERLOue7Xkjbo8/XLFU2NCqf07E/QWriEWN38QkBDEGU7cSOX0DnjOAjeF xuHlVWn3onB0payRTsJ+iY8FuetcTZYViizVMt13+JO/ebJvlRM2a43+/Gd1GEBrHq0w MLvAsfuAbAOxCIuS+G/GjTfJGql+0G7Ia0PaM2YExGEA4rq7RR75Sr4gIEcVf0fIQqZY +jAb1gjbjaUzr4z0LnmTh2f54XyiJgiuu2WYLwnbPEo/4Qs2wgwGGDAKmpFGGNjkMoRs rU6A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=PlNrN2GhAvRY7IW8hzvOGZWhxEVtG6SWuwKkUSlWRyI=; b=AwB++8IdqUDcOvo40jGyAjsVs/myI2gl6S5aYxy6F+Otx3auXb+spybMEpx5NIPrK4 0xsQ7mtR2N6ET3+QQxSFER3i++lSSeOVm9cw7g0WiDsh+hEd7U1Yxj9ZDYvWP5yXhmu7 vm16mW+9+arKXmBtK3h929lhqAFcjC5gGsgqPO+d+isHEJ96k6IG+hX0Djj17I/UqmhJ hi2PMYyFj/Pf+1uAIpxwrfUMN1+tAWmlKzT5N9uCVxKICFLD/IigSHBBeJO/x+Zh7xmk twS/hXMh/an4DyTg+6qQr+xOrkWoAQp6CvQ24LpP1dHDuhFnaqWvN1CPlgKaBQNlOuxw i0cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=DqCtJziY; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s24si2854802ejz.252.2019.11.14.01.03.18; Thu, 14 Nov 2019 01:03:43 -0800 (PST) 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=@rasmusvillemoes.dk header.s=google header.b=DqCtJziY; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726330AbfKNJAL (ORCPT + 99 others); Thu, 14 Nov 2019 04:00:11 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:37120 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbfKNJAL (ORCPT ); Thu, 14 Nov 2019 04:00:11 -0500 Received: by mail-lf1-f67.google.com with SMTP id b20so4402001lfp.4 for ; Thu, 14 Nov 2019 01:00:10 -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=PlNrN2GhAvRY7IW8hzvOGZWhxEVtG6SWuwKkUSlWRyI=; b=DqCtJziYkryUZAUqd2xAAGwJFBCGTywmDlEpqjTs1//7QvPdR0AwIUntDfUsmL7VXt inp5/f3kzSiCI/REeaZwhuroE7fO4RLz1hNiMXce1uHOOoWd/krMOrPvIsHk8VUu/Idx CVhp6Qxtadp2q8Bf0VYuQFMBrMOjcRmWU1E3U= 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=PlNrN2GhAvRY7IW8hzvOGZWhxEVtG6SWuwKkUSlWRyI=; b=ZzBhPUEaX2PJV/hXk02jmAgHr2jpMOs+eAaVrE7WUaTu5RzASgH2Uwfc1y4L9T/fW7 ffJfAdfhBW7dn45c/VzVGUN0BhL/QPHyUBClylrkkMrpndZJRh0PucUN2EibpKEXcCOm 6IfO7hRrTzsi7Fx1ZSyovHELCzMBcb+k8LQdiE8VlMzQyDFvqR4alwoFY+quyqZ42XNd SpipXeiBH1bjLQNPzytlmD17KU7hXk/UdY1mDeB+6UdisqABVL9fJ84GLQtvEEX/cPOF laJpCJZJzhEZ+4/n7WwNT/Z7wxFQyi44aIjgAIjohZ2dYBxCb7GbxmUpbkQjYv278it+ gceA== X-Gm-Message-State: APjAAAUlCIygieq7YCB4SFhHVgPTrwApS44ImqOz350tIgfUI6uigfnK H5K9KOTAluEdh0KrsOD/jNEC+A== X-Received: by 2002:a19:c386:: with SMTP id t128mr2627137lff.7.1573722009265; Thu, 14 Nov 2019 01:00:09 -0800 (PST) Received: from [172.16.11.28] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id o26sm2073916lfi.57.2019.11.14.01.00.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Nov 2019 01:00:08 -0800 (PST) Subject: Re: [PATCH v4 30/47] serial: ucc_uart: factor out soft_uart initialization 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-31-linux@rasmusvillemoes.dk> From: Rasmus Villemoes Message-ID: <73337067-953c-55e2-986a-24116fb10544@rasmusvillemoes.dk> Date: Thu, 14 Nov 2019 10:00:07 +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 14/11/2019 06.14, Timur Tabi wrote: > On Fri, Nov 8, 2019 at 7:03 AM Rasmus Villemoes > wrote: >> >> - /* >> - * Determine if we need Soft-UART mode >> - */ >> if (of_find_property(np, "soft-uart", NULL)) { >> dev_dbg(&ofdev->dev, "using Soft-UART mode\n"); >> soft_uart = 1; >> + } else { >> + return 0; >> } > > How about: > > if (!of_find_property(np, "soft-uart", NULL)) > return 0; of_property_read_bool() if anything. But I didn't want to do that kind of transformation - just a pure "move this code out and fix the indentation" with the minor edits needed to hook it back up where it came from. > And I think you should be able to get rid of the "soft_uart" variable. Eh, no, it's used in several other places in the driver. I kind of hope gcc is smart enough to see that in the !PPC32 case it is a static, never-assigned-to, never-escapes variable so all the "if (soft_uart)" branches go away, but that's not really very important. Rasmus