Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1967987lqg; Mon, 4 Mar 2024 08:56:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWaJfQTCZIIVY3VMFqYSaXHs2URuo1ljkoJZAFcy7GbIPdIl8uo2rgRUJHfZw8h7U1F4K97srT1JQNiI9nNyAVA7aRDIeDuYSF3bF0srg== X-Google-Smtp-Source: AGHT+IHoh/UwiKguzPNe25yx0FfzIffySUYrcguh67Hn6dSr0HwdbI53PcCDgLKz5DxKjze0B+Ok X-Received: by 2002:a2e:b888:0:b0:2d3:9342:4b6c with SMTP id r8-20020a2eb888000000b002d393424b6cmr4141230ljp.33.1709571414050; Mon, 04 Mar 2024 08:56:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709571414; cv=pass; d=google.com; s=arc-20160816; b=aP8cAqS8vEeGgrlxsCAOlNWDlY+kqmTajMuPjO+2mmKkdf2ZwX5ZvnG3bp5PbOeC/5 GBqWTnDypfg6XRRyngkaV/7zHr0ghEB71+eH4tlz7gp2lRTiF7DJLmPDHOg2Y4oPlR6W 6lZlY0UviZ/XvK9iMH0KyDmf42jK5HB5dEF9hjWGqWrlGH6lwujR/z3+VIF3HyD+LIbi mKBE1woTeT0Cg63SL7q8vOJiiv8cs0NfRL8ihyD9ta/lAQfpnjxJJSd6fU+8XlgY/QpM gkjkO0kyqzSIYEbXZkmk/J/mI1NUweWiMbnfkcVttxcB4+fE+wTI+2CAmbz7nRNRqcj2 NiTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=IjVqc05Kv2mClcc7wwWTVS45kmeM77solvmKg0C+3bs=; fh=3KYPR7QXAO3Qw8iC6kE6TwvD5qXD4BfVx85ivp4WOmw=; b=bP02cASSsQs3iUysGuRgbYmNeZ3EkhGWwPUrenmdS8J/iuYxZjeJC69dYIwYq36mGL i0xuJxhXsPy38zU7S1zhLkSBbX9vTQtFNFY/jv701ZG3YTgz9KKZW5xOJNqPaMxbY5C3 /CHd6x6AeAsbgwQzQ446R2P3jcUAss1oyQ0LXu5BAqIWlKnKSPvMpsKzvCRQyt/kpQTx wnsN+2ERkeFsVoLuLWNwqaZuoF80Y379LBWQZpatUtW08uviUnFvGr22j0iFC/zUcIGD 8+2lCHAKBqt+Sx9+dH/hVAkAlgBsSuwV9hnIcpi24bKM0eWyCuV8RK5B098d28Th8tmD igKg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZbQz0mt2; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-90704-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90704-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c2-20020aa7d602000000b00567308a366asi1046551edr.677.2024.03.04.08.56.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 08:56:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90704-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZbQz0mt2; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-90704-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90704-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id EE7191F27477 for ; Mon, 4 Mar 2024 14:07:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 666324176C; Mon, 4 Mar 2024 14:06:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZbQz0mt2" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF5EC224CF; Mon, 4 Mar 2024 14:06:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709561217; cv=none; b=CP0skdvJApCn/jXBvK+zq9YzyscPTEO4N39sOJJQ910LNQ7XUS9f6L/7HF31e5soc3YVmQOUii89UUkA8bCRbqkf8tFEkvNhPiyDkqbAbAmgXbsTqBf8FtsoUxaoDuo7YgVl9Jv+u79O0jckZ780tNwpTr/Okhms2Letu9x9MWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709561217; c=relaxed/simple; bh=oPgbP6Y7UWq3750QzKfWsGmdMlFfdlCl9robmFmEbdI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=F17nPM/OZs/SbwQbIGxSYv/hW3hGgcyY9ghQiqLdkJnRM8ogfiJ8Sa4XVwibIUpJe8oLRYOm9PYLJox3QhB39Fb5fUMsJGiuPPazEuutpUInZJta11RMasTXkKcyCyKCWccpUhfculmh92izDmuaknRttY+UvH/52PQvsVmvs70= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ZbQz0mt2; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709561215; x=1741097215; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=oPgbP6Y7UWq3750QzKfWsGmdMlFfdlCl9robmFmEbdI=; b=ZbQz0mt28Xneu4vwNwCHhZ4EsYoDTAcR+03HZlbb6zi8VNdg4z863FR9 +q1JOvwY3i59iuGPE5VPR+zwrlwl9uZ4kkjYbmlxX4p9ecjW/t5lEKRXv ohv896HbtXb1Bi4rm4cwFwgng2zLloWJodj9MUprtZwUe1Q01lr0m/59e fWG0e5RgMzrZi4yGvZSGODWYbeqRV9W+ByRTuWsn32UQ2gyNyNwf4hc30 xCUSxXZbLs9XmFYaVHcyDOmxbT7RrwrsuovvjRdFkMh6jW4U44G2CU9/2 cYIwXCFO51PXK6AJBA6jxq10+WcMTlXqzPcs2xdk5PZTukqMDQ+Gd3O/D g==; X-IronPort-AV: E=McAfee;i="6600,9927,11002"; a="4214178" X-IronPort-AV: E=Sophos;i="6.06,203,1705392000"; d="scan'208";a="4214178" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2024 06:06:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11002"; a="937040569" X-IronPort-AV: E=Sophos;i="6.06,203,1705392000"; d="scan'208";a="937040569" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 04 Mar 2024 06:06:53 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2A19931F; Mon, 4 Mar 2024 16:06:52 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v1 0/2] iio: core: Fix and cleanup to iio_device_alloc() Date: Mon, 4 Mar 2024 16:04:31 +0200 Message-ID: <20240304140650.977784-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This is an exctract of the two patches from https://lore.kernel.org/r/20240228204919.3680786-1-andriy.shevchenko@linux.intel.com In v1 (extract): - removed unneeded 'else' branch (David) - fixed typo in allocation cleanup (David) Andy Shevchenko (2): iio: core: Leave private pointer NULL when no private data supplied iio: core: Calculate alloc_size only once in iio_device_alloc() drivers/iio/industrialio-core.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- 2.43.0.rc1.1.gbec44491f096