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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF782C4167B for ; Thu, 30 Nov 2023 18:00:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346695AbjK3SAO (ORCPT ); Thu, 30 Nov 2023 13:00:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231810AbjK3SAN (ORCPT ); Thu, 30 Nov 2023 13:00:13 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67AEA103; Thu, 30 Nov 2023 10:00:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701367220; x=1732903220; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=0/A5/goMjTlKWOCgMDBXlspOvINKnyhEr5/eCD6JmJc=; b=PAT0Ss+cPFNYCzpO1PYWF5/7iDnzNgEQ8MCmQXcurt80q6Az4ZDjNami 6ndGHe6GCaz1/pLJtDd8aioqgsQXivwjsacPLMenKK86FLVp6spVF075y YEGSO7gGD/k7H5ZP25tyBO59TUUukrMnKIEKN3IitICo93U/Jy5j+ot6o PPt9MkshQo0hj32yD4hJRymJrkI51kJW0nc4B3ZJSnMgd2WeY7vxZnm1s eAydCZuiUcK9tKXJteVdIPAjIaBeOX0zrSkB9oEGh8hm/XUZ8MZpz5eWv tn5KtrrvUze5QJMhRkUEuKtthEmK+LNReR+7KfIhmZ5aHssLs0CsaL93Q w==; X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="378391949" X-IronPort-AV: E=Sophos;i="6.04,239,1695711600"; d="scan'208";a="378391949" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 10:00:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="745722742" X-IronPort-AV: E=Sophos;i="6.04,239,1695711600"; d="scan'208";a="745722742" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga006.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 10:00:18 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1r8lKh-00000000m4P-3ZXT; Thu, 30 Nov 2023 20:00:15 +0200 Date: Thu, 30 Nov 2023 20:00:15 +0200 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v2 01/10] gpiolib: provide gpiochip_dup_line_label() Message-ID: References: <20231130134630.18198-1-brgl@bgdev.pl> <20231130134630.18198-2-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 30, 2023 at 06:48:06PM +0100, Bartosz Golaszewski wrote: > On Thu, Nov 30, 2023 at 5:27 PM Andy Shevchenko > wrote: > > On Thu, Nov 30, 2023 at 02:46:21PM +0100, Bartosz Golaszewski wrote: ... > > > + char *cpy; > > > > So, why not naming it fully, i.e. "copy"? > > > > Ekhm... let me quote the BigPinguin :) > > -- > > C is a Spartan language, and your naming conventions should follow suit. > Unlike Modula-2 and Pascal programmers, C programmers do not use cute > names like ThisVariableIsATemporaryCounter. A C programmer would call that > variable ``tmp``, which is much easier to write, and not the least more > difficult to understand. In contrary the cpy is more difficult to understand. `git grep -lw cpy` vs. `git grep -lw copy` suggests that my variant is preferable (even excluding tools/ and Documentation/). -- With Best Regards, Andy Shevchenko