Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1404942lqt; Sat, 20 Apr 2024 13:47:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXVDaa2tQuTXPUIZu307g7/TjCLFhbYEsNSaTfBS/wPAmmJ+Mnqqv72M009h5qX6kbeSUvRIPuuz/ycpjwexCVkaHyOyi+DOPlRtHl/bw== X-Google-Smtp-Source: AGHT+IF0IUvo/iGlYSLqDf5XBl1uHZlhf80JcjArB4p/KpIKzSzUMfqvVz7IjxPa999pT8nda8xd X-Received: by 2002:a05:6a00:1915:b0:6ef:a0fe:c478 with SMTP id y21-20020a056a00191500b006efa0fec478mr7353252pfi.34.1713646067588; Sat, 20 Apr 2024 13:47:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713646067; cv=pass; d=google.com; s=arc-20160816; b=ZMUKp0VFpf93syv3S7g0Qpx07QRehT0nP6msF2jYHSMqJRQJThiqo9a48yxERGWUz6 S0hjpHhx1rvdWaOdTCAFBOLXOBSfmSb1uSKZJ+ONaRVOK4mcHuByXwoXkzmMxJE3cE/x KqDlG/X3E1rgHd7HXjM62sZWK4bxx9tw8F219y0LZ6nErCQ33d3qpkUwQpqLHxJB1HS9 ddxV1jBUo7w44ybsmBsU7WFHB0t5GahxVGHUzL4Eux93unJi657fq0Q6e2w38tXbRNuM W8dWReYAkur2ZgWENlgvVuBryHvySjiivWumpl9uQ6TNT+C6kjWvg19HsnIZTLW9G72f KH7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=kb/bevCZdlKe2zh21irqMcJQYjEy0O/ZCeu3ucaLGIQ=; fh=xENKuSgfk1AGLJDCII1mAQkTz5xpvUE7QNu8zkqc+aQ=; b=Hjz2diroaIO/a6ZSI07E8WEhWa5sJXoZ37rTuUWjLrp/aFkbqB7AUNUQSydMAzRQJB Kv8yaBh9JO3mE8bzvO3/ElUTxD0L8J+rg16kA6KPANQMnio8yt4Zprd8nY6ebmqMCgea SSXoJcr/WuyulbJi6wHgtc/UIvoNRdNSY+JKVjRpsMxLnnXKlw1M16oS9NpxPUvtxMKw QuO4SsqZGhO8TJsD96al9xYBeTxoPeDcXL4pKObqLBIUZtp26f5O1cvK+gvsFXJ8KC6R Y5QhWvhOqIMJqbzxwA/XuYDz7G3DK+9W4k/87Q8uS4xKdXjDXx69BL0JBOI387WB8LTY O+mQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M6bC9itG; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-152375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152375-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t8-20020a634608000000b005dc529adfbdsi5291807pga.735.2024.04.20.13.47.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 13:47:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M6bC9itG; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-152375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152375-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 304BA2814F2 for ; Sat, 20 Apr 2024 20:47:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 653C147F7F; Sat, 20 Apr 2024 20:47:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="M6bC9itG" Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF96B205E36 for ; Sat, 20 Apr 2024 20:47:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713646059; cv=none; b=orsBRTTHD33gKCO/AEkHbqrvchv1DbDjmFlVjkWXdqC9DrafB2UgmAPcYaPfcWHc5f1mPD+L7OAykQk2XSxy+W/54/AKNh7ukUZYvj4M621G8aFhdV9GgrA/e8LVybun1EU3ZXfXyaCWPgGPQ771GP6BvaLExlf/tSsDvGxuXag= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713646059; c=relaxed/simple; bh=nAX4qtsNUWhy1uiAgeSRQF1UqmwuPnkAS2XUGJmyi4U=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=FqkIplXWHrXGElrBAdqHV3B9RU2s/fXKXX/lsmLgm9q8yMq1126SJz9oI9b6zdnDnbq+pkcj5JcqA2Zo2TUV0sr+jnY2MguYchBjKNz7ST4BmegQJBT+Q/8lYTZg7qtfQAbUQWVWJmSMuvbOU3VBuZbTxr4MX+hUf7o3rnl/zEQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=M6bC9itG; arc=none smtp.client-ip=209.85.210.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-6ed06982819so80359a34.0 for ; Sat, 20 Apr 2024 13:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713646057; x=1714250857; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kb/bevCZdlKe2zh21irqMcJQYjEy0O/ZCeu3ucaLGIQ=; b=M6bC9itGHIEIvgg7Rk3e+m6FR7UADyUUOfdwnC0xT+8EOzQ3SvhnFWkkP7nT1DaZn+ XV/SQyjAxoGFW2rCpz8YDR9cu48+95zgTe1ZOLBy7/HG+gCwQAOca7Cs+4sJwjHesSX5 4ASExXETyu/4/7UEgAzuTC0BhrIIeFKdbm+8fClUJEoL56j89Az2CiQWZchxeCftJ+9h dAq12ID49Ev9AZGeNIHSjZMEKVYHobBu/66ZYDNWExFaBKBULlToK9Rc5mFWdG4Z5vlo UK5Ep2D0R0vvc7b8tznICiJY6UIHwXFYRQx8DQwvRRj4cHIMA/YVI0DLz3sR+RQhxXkN imhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713646057; x=1714250857; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kb/bevCZdlKe2zh21irqMcJQYjEy0O/ZCeu3ucaLGIQ=; b=aW6q3m1WEbplKix9jxvz2ncPlr/rWIw9517sOV+lwwCyCNbZGm91pIAwEonKK9LucX 6vnw5K1MTnd4vt8Jswru2/E6g5lRS9+DZhdtYZmPi1LEQ160YyZS6wL/lrPgqlhgd5rg Nw39Aop9+90hLmuyr3QB/tBUrKAp2OU2O73uwmV4ZClEj/TZEVQh8VyL3+wIw7wfQFvh SmSyAtxNCJw0E6JgLu9uZ3IThM2LtBEuTEn9lfTZpMqdmy1fbyBdZRzBx6o1wVbbhg1K DqOCMUBjgvVgLovaASsynPPcPyfnu9yal4LTt9M8GBBdVvRyS3ZdtklDK9YTI8YdKDE+ iWRQ== X-Forwarded-Encrypted: i=1; AJvYcCXqur3YPmXUVnKSjhKbD6ek0zgzGB0S0Yc+4y/dVEsrYj2ge9WT9xNTcNrAtsJ3NgVvIbdBiP9uamh2aagDpVG7FQodML3nkNItMKQx X-Gm-Message-State: AOJu0YwhJHlEVkEqaxpRJdVk9Bs1lDFlTqUHX64aFz9XgAjUQ24pMZ3N /PV/SW5vYdOtpkziVnhg6V6UB0rOS/txPld5SBCqQBHpeEvAJo/rUswce/ki/n2irarObgf1DKP azY6ERKdYneLhBZ+7VsFd3zWirBgdC9bfjpEfBg== X-Received: by 2002:a05:6808:10ca:b0:3c6:be9:f4f9 with SMTP id s10-20020a05680810ca00b003c60be9f4f9mr8118471ois.28.1713646056797; Sat, 20 Apr 2024 13:47:36 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240420164927.15290-1-prosunofficial@gmail.com> In-Reply-To: <20240420164927.15290-1-prosunofficial@gmail.com> From: Dmitry Baryshkov Date: Sat, 20 Apr 2024 23:47:25 +0300 Message-ID: Subject: Re: [PATCH v2] remove indentation for common path [linux-next] To: sundar Cc: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org, neil.armstrong@linaro.org, u.kleine-koenig@pengutronix.de, christophe.jaillet@wanadoo.fr, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, skhan@linuxfoundation.org, javier.carrasco.cruz@gmail.com Content-Type: text/plain; charset="UTF-8" On Sat, 20 Apr 2024 at 19:49, sundar wrote: > > Added check if pointer is null and removed indentation for common path > > Suggested-by: Greg Kroah-Hartman > Signed-off-by: sundar > --- > > Fixed nitpicks in code according to comments received on other patch. > > https://lore.kernel.org/all/2024041103-doornail-professor-7c1e@gregkh/ > > goal is to get rid of of_node_put,but sending this patch first to do one > thing at a time. > > Changes since v1 - fixed the typo error for spell from identation to > indentation > > v1 patch link - https://lore.kernel.org/all/20240420145522.15018-1-prosunofficial@gmail.com/ > > drivers/usb/typec/mux/nb7vpq904m.c | 49 +++++++++++++++--------------- > 1 file changed, 25 insertions(+), 24 deletions(-) > > diff --git a/drivers/usb/typec/mux/nb7vpq904m.c b/drivers/usb/typec/mux/nb7vpq904m.c > index b17826713753..fe0257840dd5 100644 > --- a/drivers/usb/typec/mux/nb7vpq904m.c > +++ b/drivers/usb/typec/mux/nb7vpq904m.c > @@ -321,35 +321,37 @@ static int nb7vpq904m_parse_data_lanes_mapping(struct nb7vpq904m *nb7) > > ep = of_graph_get_endpoint_by_regs(nb7->client->dev.of_node, 1, 0); > > - if (ep) { > - ret = of_property_count_u32_elems(ep, "data-lanes"); > - if (ret == -EINVAL) > - /* Property isn't here, consider default mapping */ > - goto out_done; > - if (ret < 0) > - goto out_error; > - > - if (ret != DATA_LANES_COUNT) { > - dev_err(&nb7->client->dev, "expected 4 data lanes\n"); > - ret = -EINVAL; > - goto out_error; > - } > + if (!ep) > + return 0; > > - ret = of_property_read_u32_array(ep, "data-lanes", data_lanes, DATA_LANES_COUNT); > - if (ret) > - goto out_error; > + ret = of_property_count_u32_elems(ep, "data-lanes"); > + if (ret == -EINVAL) > + /* Property isn't here, consider default mapping */ > + goto out_done; > + if (ret < 0) > + goto out_error; > + > + if (ret != DATA_LANES_COUNT) { > + dev_err(&nb7->client->dev, "expected 4 data lanes\n"); > + ret = -EINVAL; > + goto out_error; > + } > > - for (i = 0; i < ARRAY_SIZE(supported_data_lane_mapping); i++) { > - for (j = 0; j < DATA_LANES_COUNT; j++) { > - if (data_lanes[j] != supported_data_lane_mapping[i][j]) > - break; > - } > + ret = of_property_read_u32_array(ep, "data-lanes", data_lanes, DATA_LANES_COUNT); > + if (ret) > + goto out_error; > > - if (j == DATA_LANES_COUNT) > + for (i = 0; i < ARRAY_SIZE(supported_data_lane_mapping); i++) { > + for (j = 0; j < DATA_LANES_COUNT; j++) { > + if (data_lanes[j] != supported_data_lane_mapping[i][j]) > break; > } > > - switch (i) { > + if (j == DATA_LANES_COUNT) > + break; > + } > + > + switch (i) { > case NORMAL_LANE_MAPPING: switch-cases should also be shifted one level to the left, see Documentation/process/coding-style.rst > break; > case INVERT_LANE_MAPPING: > @@ -360,7 +362,6 @@ static int nb7vpq904m_parse_data_lanes_mapping(struct nb7vpq904m *nb7) > dev_err(&nb7->client->dev, "invalid data lanes mapping\n"); > ret = -EINVAL; > goto out_error; > - } > } > > out_done: > -- > 2.34.1 > -- With best wishes Dmitry