From patchwork Fri Jul 21 17:00:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12424 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp350896vqg; Fri, 21 Jul 2023 10:14:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlHJqeAM4Njsg6hNVYzpvpE2IFllIYxUNIsgudIPSIOLgvsW8Tj/gruGbJ56utRpZrqALCDd X-Received: by 2002:aa7:d948:0:b0:51e:338f:863b with SMTP id l8-20020aa7d948000000b0051e338f863bmr1993173eds.11.1689959679482; Fri, 21 Jul 2023 10:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689959679; cv=none; d=google.com; s=arc-20160816; b=lAZTGKbx2f3j3Y2XCFR8cR8j1J/RWSiNkeaObK9YmukQt/irhy4aYoenOXuOEG3hog J38XnN8txtGyIgIfvC72dM34mzl3y9PSim9jHpKegtmHIxxDC1kN17pMrzneiXi5Dk+j lHg1Q0Uu3/x+uvmyllz9s8vkhmsSSQu5HWZAXbbq4/qkpRlqH2TpQf5Ay+zXRp4LUxvg PwiCYp2axs4s3xNIYM0o0jTW9wqDeoBWl+YJQJhR0K6Ua53R4xSStjHW69l5FOEPUdtY /9RksxG7KmkMI+Cb98e7BEFPC2ldSWVgC2K6SDdzvI76f2BsTfJNL69JrI5J/pPkyRbv 3xkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CvD5ZqEI6YN4huKuQi1uQSp29+bSrMTHGyVDPenmtTA=; fh=UOk5tC92rpasvTHsS8FNeq1ESsZGN5rcMuNSzha6ebA=; b=blS1g1HLkKfXbNGuIs3esxTaD7MKELL1bRnHfJq8ngWVp3v4SeglRgGUjJtqAxED3f VQQzKLjQ2NkPG73cQEMm1fQmt6iewxftn3hoAziZRDl2AU3/DEbNJedPYk2DWuOVYJX3 yoOmR4MBNzK4ImrDlT8+9ja/x/qEz8huTsvVam5qS6gOanP+KWVDy7wJKZXlDV8wZvUU End2psBbaDYnZx5bQU4QzZCbJ0rH4hP0G25VN1TVOIFUADRsojsPgipzs0cbcE4Mliot 6baEVlfM7GTL4e0bLK6UXUNSq/DBASB9dUkbHTaTG5WLLfAReLFf7bvLDZH6h8XMn+2T bG3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hAjfEHxR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l21-20020a056402125500b00521a873b32csi2469274edw.327.2023.07.21.10.14.14; Fri, 21 Jul 2023 10:14:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hAjfEHxR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230516AbjGURAX (ORCPT + 99 others); Fri, 21 Jul 2023 13:00:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbjGURAU (ORCPT ); Fri, 21 Jul 2023 13:00:20 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B43C62D56; Fri, 21 Jul 2023 10:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689958818; x=1721494818; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=A6Q5/fuyZHuH0R3Z44L/nyNITqllFqxNyEwfzvH60Kc=; b=hAjfEHxR8j5aHcvrBBlZV7i90r218uLm+vPeAF2vwYqXD8dgiZhZzNj1 W+O5asAe5I+j6aWV+7M7xdpQLja1g26rG6M8D4IW5/QGkcfhSWBdrJDal VDw7UJF/H9m+kggT1oJJpxGLLsAcW5XKCap0uaRQzo7o2tDC6ZnfR1nqm bxnYYfEOqEH08JuiNh0Ru0O/Lz2L/4o6nZI85w16steT/6bTY/ZGaCq/F L7egz0F28sUoqj+r8VGvWKjOP3MArxHncH/lqbKRkMIvhLH8MBAEAL57q sJHwIhrHMLuBJvB7a67I5hLaoMmSPScC6HGI/FE4jlen2vZgfOFPXzcp1 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10778"; a="453443900" X-IronPort-AV: E=Sophos;i="6.01,222,1684825200"; d="scan'208";a="453443900" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2023 10:00:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10778"; a="675106515" X-IronPort-AV: E=Sophos;i="6.01,222,1684825200"; d="scan'208";a="675106515" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 21 Jul 2023 10:00:15 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 20983204; Fri, 21 Jul 2023 20:00:23 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v2 0/8] iio: core: A few code cleanups and documentation fixes Date: Fri, 21 Jul 2023 20:00:14 +0300 Message-Id: <20230721170022.3461-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771977848754704168 X-GMAIL-MSGID: 1772051160769037706 Just set of almost unrelated to each other cleanups against IIO core implementation. The positive LoCs diffstat due to first patch that adds a lot of documentation for the new added macro. v2: - sprintf() --> sysfs_emit() (Nuno) - added tag (Nuno) Andy Shevchenko (8): iio: core: Add opaque_struct_size() helper and use it iio: core: Use sysfs_match_string() helper iio: core: Switch to krealloc_array() iio: core: Use min() instead of min_t() to make code more robust iio: core: Get rid of redundant 'else' iio: core: Fix issues and style of the comments iio: core: Move initcalls closer to the respective calls iio: core: Improve indentation in a few places drivers/iio/industrialio-core.c | 226 ++++++++++++++++---------------- 1 file changed, 115 insertions(+), 111 deletions(-)