Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp470105rdb; Thu, 8 Feb 2024 10:58:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXqUxP2ddlF3j0WsRKWw/1oN8OE6GQeq3fUFGkfgOJ1WVtntMZ2JI9vW9BHvV6puE9qwtegu7xQ1v4lc6g10AlVSfMbZV018y3M7Smmyw== X-Google-Smtp-Source: AGHT+IEzxu9HAkQlgU89ZxSrItbGy/P/MrncpUxSB/qcQ4UevR/dEr5AZc18G6I66WWXorjoHdWi X-Received: by 2002:aa7:c90b:0:b0:55f:8657:c7f6 with SMTP id b11-20020aa7c90b000000b0055f8657c7f6mr103637edt.14.1707418722728; Thu, 08 Feb 2024 10:58:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707418722; cv=pass; d=google.com; s=arc-20160816; b=g14Sn0nN3R6YhWrl45Z/Fx6c2AJbr02rqA4QTCO5604n6LNvmDdIyhef/VR3tVsZhU e9kKEqALBXHEI2NQC3SUp9m4zbVySHbvExMXJ2h5Z71MHkiebZttzhV3d6obYE/Xy0PG 4OTiZvMYKBHZJt17Yi+gvD109I6jJSCN0AIbmt3Z0IKI0TQav0CYLcqFC/ivQPlO1MF4 zLk/5lEklxTPgfYd9KJvMo9EJJlM3IqddJqPAFtKgw29UJLD1Cbv1BGhjaTFw69FyTlO 2acFceV2LKiXnWWzRQu1zgRkQgSC/DKoQCIg8AV2yksnZCRg31OCV+kThrx6w4wRZ+Ah tmQA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=7M72bWwTNzcNuG2Rbo+yBdwaFcyGSuxvbkFx7bP710M=; fh=sczT7NMUjRkpmdrsdbu/ASo5WTTaI5zoYQ8Jc9USCpk=; b=EW7nHmmsDV7Iz9MGKBcOp1s4+YPpnXnTFDQ5dtjfSGb8E8FsSlGlQGLb13HCDN6Rkg EST++FdfuatWqnT/EO9LYQDoehEmeMPk1cPlorLA3C8Qhw3KcR+LZrqfXMV6nKywfFST n864wITgeC8bB6wO1YEMs61GuS7IGwHHgv6nizMQajGGZANAgdDJQMkRcC3me/iRSaD7 m+T6IxnH5FyXBUWlx84zMR6lxAqsHrOaTDP4xjR0k3xiKTVW/HPvdW1sLTy+hKv3numt Q/77zl7gSpBa3Z7l69RQxIvFeE6xunnp8al1e16MkgE8Zmjlyn/iUF3CrJzKbN8DpOcY celw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=h6Dh9ahQ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58584-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58584-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCWXGZWTSmR16+gyp6Dl0tBAG4yYT21Zd7P77kpADBOX2pcVKjfWL0SIw1P6L3lwupPRhTVKFB6ybRTsrSKEr2nYTGLWLc/7BEWNgyayIw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l7-20020a056402124700b0056023592583si10883edw.396.2024.02.08.10.58.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 10:58:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58584-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=h6Dh9ahQ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58584-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58584-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 C4D961F2E992 for ; Thu, 8 Feb 2024 18:57:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6ABCB4F1F8; Thu, 8 Feb 2024 18:49:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="h6Dh9ahQ" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 ACAF7383B8; Thu, 8 Feb 2024 18:49:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707418181; cv=none; b=NHmZMaeCGqo+6NRxYsyvYiBgVVKb8Y3W4BW2UhUBsFoSIEqf1UUTIX9EHQckgioxRX47mtahgUxWRT/Q8Qe4Ku9W0RKvTIRjwSJ95zbjSZJmRhv9MgmtuWi5AoOZ3T+crN1RIzC41/5kKHvO2L7gUtW+tnoScJmAsb2wKslcI3g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707418181; c=relaxed/simple; bh=FH8g0LViq9a54GUNHUMfITSFf708fBC8temf69sHlcE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i6SjRyrNyNpZ0Xus86ygZizkbbHHqp/eUUAvomUBT9OavnXCe3PBkU05f+rxN2+WgnKp2PfoeyH+FD3eyKRasTX24En2crQZK88CgjcsViZ++tNMGr79OAAutpzGeSSaxCBjWaP6IkXCYZRKuPen71b1ts0n2/H9RQND1E1XaSw= 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=h6Dh9ahQ; arc=none smtp.client-ip=192.198.163.19 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=1707418179; x=1738954179; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FH8g0LViq9a54GUNHUMfITSFf708fBC8temf69sHlcE=; b=h6Dh9ahQP+rCEf+4jUtz0ewl+O6oqSwcustfIP0OfKv409rJSY2/WEMV wSwl1ktHrg2UCt7yLoBYqhdIKCkMcz4a9ZsKx6F7qtR1fpob8AtIslzt5 EYJDVdzhlhMIrpkKXp7NVDNZAR1fQvUhFZu2cm68cpi4nr3+wpzbRDPeh Z3db5VfAHGBBwVV9Ut1wCJpj5VBUk7G6pSr/EZuTC/jiHrjTJci2RU7Sw rIWY52bLD7WxuIDHrCE5yBUDdqvQKkfNkledkqFdqIFxN6kraB8R47SOa xrhVECBYRWifZW4TJ4bMZ3zXOy47ahlmGLYKzbPEWnxFz2tN9gL6+T9vR A==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="1186152" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1186152" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 10:49:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="934215541" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="934215541" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 08 Feb 2024 10:49:26 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id AC41CF4D; Thu, 8 Feb 2024 20:49:21 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Miguel Ojeda , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Robin van der Gracht , Paul Burton , Geert Uytterhoeven Subject: [PATCH v1 13/15] auxdisplay: ht16k33: Use buffer from struct linedisp Date: Thu, 8 Feb 2024 20:48:11 +0200 Message-ID: <20240208184919.2224986-14-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240208184919.2224986-1-andriy.shevchenko@linux.intel.com> References: <20240208184919.2224986-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit struct linedips embedds a small buffer for the string that we may reuse. Update the driver accordingly. Signed-off-by: Andy Shevchenko --- drivers/auxdisplay/ht16k33.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c index b104f08252dd..08cc05b9d216 100644 --- a/drivers/auxdisplay/ht16k33.c +++ b/drivers/auxdisplay/ht16k33.c @@ -85,11 +85,6 @@ struct ht16k33_fbdev { uint8_t *cache; }; -struct ht16k33_seg { - struct linedisp linedisp; - char curr[4]; -}; - struct ht16k33_priv { struct i2c_client *client; struct delayed_work work; @@ -97,7 +92,7 @@ struct ht16k33_priv { struct ht16k33_keypad keypad; union { struct ht16k33_fbdev fbdev; - struct ht16k33_seg seg; + struct linedisp linedisp; }; enum display_type type; uint8_t blink; @@ -412,10 +407,9 @@ static void ht16k33_seg7_update(struct work_struct *work) { struct ht16k33_priv *priv = container_of(work, struct ht16k33_priv, work.work); - struct ht16k33_seg *seg = &priv->seg; - struct linedisp *linedisp = &seg->linedisp; + struct linedisp *linedisp = &priv->linedisp; struct linedisp_map *map = linedisp->map; - char *s = seg->curr; + char *s = linedisp->curr; uint8_t buf[9]; buf[0] = map_to_seg7(&map->map.seg7, *s++); @@ -435,10 +429,9 @@ static void ht16k33_seg14_update(struct work_struct *work) { struct ht16k33_priv *priv = container_of(work, struct ht16k33_priv, work.work); - struct ht16k33_seg *seg = &priv->seg; - struct linedisp *linedisp = &seg->linedisp; + struct linedisp *linedisp = &priv->linedisp; struct linedisp_map *map = linedisp->map; - char *s = seg->curr; + char *s = linedisp->curr; uint8_t buf[8]; put_unaligned_le16(map_to_seg14(&map->map.seg14, *s++), buf + 0); @@ -451,8 +444,7 @@ static void ht16k33_seg14_update(struct work_struct *work) static int ht16k33_linedisp_get_map_type(struct linedisp *linedisp) { - struct ht16k33_priv *priv = container_of(linedisp, struct ht16k33_priv, - seg.linedisp); + struct ht16k33_priv *priv = container_of(linedisp, struct ht16k33_priv, linedisp); switch (priv->type) { case DISP_MATRIX: @@ -471,8 +463,7 @@ static int ht16k33_linedisp_get_map_type(struct linedisp *linedisp) static void ht16k33_linedisp_update(struct linedisp *linedisp) { - struct ht16k33_priv *priv = container_of(linedisp, struct ht16k33_priv, - seg.linedisp); + struct ht16k33_priv *priv = container_of(linedisp, struct ht16k33_priv, linedisp); schedule_delayed_work(&priv->work, 0); } @@ -663,14 +654,13 @@ static int ht16k33_fbdev_probe(struct device *dev, struct ht16k33_priv *priv, static int ht16k33_seg_probe(struct device *dev, struct ht16k33_priv *priv, uint32_t brightness) { - struct ht16k33_seg *seg = &priv->seg; int err; err = ht16k33_brightness_set(priv, brightness); if (err) return err; - return linedisp_register(&seg->linedisp, dev, 4, seg->curr, &ht16k33_linedisp_ops); + return linedisp_register(&priv->linedisp, dev, 4, NULL, &ht16k33_linedisp_ops); } static int ht16k33_probe(struct i2c_client *client) @@ -754,7 +744,7 @@ static void ht16k33_remove(struct i2c_client *client) case DISP_QUAD_7SEG: case DISP_QUAD_14SEG: - linedisp_unregister(&priv->seg.linedisp); + linedisp_unregister(&priv->linedisp); break; } } -- 2.43.0.rc1.1.gbec44491f096