Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5901750ybl; Tue, 10 Dec 2019 13:27:09 -0800 (PST) X-Google-Smtp-Source: APXvYqzKSpFzGL6EqbCo84oFujaCfWLUs/IYW8BDa5FQy7BndqkJfN/a+laj7ndiLx+4eQjVvYkl X-Received: by 2002:a05:6808:3b3:: with SMTP id n19mr66376oie.23.1576013229261; Tue, 10 Dec 2019 13:27:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576013229; cv=none; d=google.com; s=arc-20160816; b=wniv/+7tP1swMJmNArrTxgbEFuF4xWyzRn4FUW/jW4rwl0Hb73fHwr/Pgt0jmhiR8p hNRt9za9BPDCHi1HTPioy70D3qRO+JhtdNEZBwxBGeT1oapk4q32V5Spt+w3jtTXdgia JwkNsUjP0JomoZ1hnzT9liPHPT/826ife2j/1P1O0JENZ3xaXUt74aPQ1JBzG4Whu5oj 6xN72xlrDRGEzFZOxMIqTO3T8uUIyoN6VW3QwrzsFZnWDZLGmqqKc1uAy1k4G/pWycCc BczzFUZ2vCLFWbVqA1TmPXgoVo/QVAgIC/C2TRDfPw068GWr2nKBwI2lFFzkEUB6JSTw 097g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T/NgyURKDCGNR5ZBU0tRSvRHUiOKpPFSRAQpfYPToN8=; b=dxx+8E5BwUyUVvYNU0fP06xRbakcHlzP6AbsBBlSx9Xfe5FVhkBbQmy4jj/EFIn09N wxjbuX3ib3sTrojvj+RuMWL9ITFx3H++JTebjd1y1+P3NiVFM15+p5IQz0jTadNSeXuQ XWnF8QQRayi35yrSqzATPkfeXpynV72f+nPRo1W801RfES8m2YzshqkFVeeoNwV09ses MTfj1mcRhv569pXRyNHUzAa+QEDjXkaBNm857fqGSqXaeOx6wXhvnUWAIeJOdTWahyHC CyvLVYuPNmFoEn/zXZStN/7Ckf9QYOh31AL6FmrKNVOfWpPQFeWnHNIcz9U6aV+87buv HYXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="gIgKs5/t"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w187si2472330oia.166.2019.12.10.13.26.57; Tue, 10 Dec 2019 13:27:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="gIgKs5/t"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729549AbfLJVZh (ORCPT + 99 others); Tue, 10 Dec 2019 16:25:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:56174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727426AbfLJVZX (ORCPT ); Tue, 10 Dec 2019 16:25:23 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 312DD24655; Tue, 10 Dec 2019 21:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576013122; bh=Uox/MUlOxAcA9VC8+NstKQ1ozhs/1ymmQvDGzA/Jz60=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gIgKs5/tAyf6RUbPbIzszs9oul2wL/xPIf26jFtwUM3A/0yDiRk8AKV730kR2lp7r bD39vAtRbwUeLmB01B+CsBfAGlo4HwwLwJUz8PzO3m2vZwIVqr2lfntqCNPL/6vWei 5a6GBqOlL3g4itC9dXQyu39Jv39a4RTuLoo6yt7s= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Krzysztof Wilczynski , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Jonathan Cameron , Sasha Levin , linux-iio@vger.kernel.org Subject: [PATCH AUTOSEL 5.3 009/292] iio: light: bh1750: Resolve compiler warning and make code more readable Date: Tue, 10 Dec 2019 16:20:28 -0500 Message-Id: <20191210212511.11392-9-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191210212511.11392-1-sashal@kernel.org> References: <20191210212511.11392-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Krzysztof Wilczynski [ Upstream commit f552fde983d378e7339f9ea74a25f918563bf0d3 ] Separate the declaration of struct bh1750_chip_info from definition of bh1750_chip_info_tbl[] in a single statement as it makes the code hard to read, and with the extra newline it makes it look as if the bh1750_chip_info_tbl[] had no explicit type. This change also resolves the following compiler warning about the unusual position of the static keyword that can be seen when building with warnings enabled (W=1): drivers/iio/light/bh1750.c:64:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration] Related to commit 3a11fbb037a1 ("iio: light: add support for ROHM BH1710/BH1715/BH1721/BH1750/BH1751 ambient light sensors"). Signed-off-by: Krzysztof Wilczynski Acked-by: Uwe Kleine-König Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin --- drivers/iio/light/bh1750.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/bh1750.c b/drivers/iio/light/bh1750.c index 28347df78cff6..adb5ab9e34390 100644 --- a/drivers/iio/light/bh1750.c +++ b/drivers/iio/light/bh1750.c @@ -59,9 +59,9 @@ struct bh1750_chip_info { u16 int_time_low_mask; u16 int_time_high_mask; -} +}; -static const bh1750_chip_info_tbl[] = { +static const struct bh1750_chip_info bh1750_chip_info_tbl[] = { [BH1710] = { 140, 1022, 300, 400, 250000000, 2, 0x001F, 0x03E0 }, [BH1721] = { 140, 1020, 300, 400, 250000000, 2, 0x0010, 0x03E0 }, [BH1750] = { 31, 254, 69, 1740, 57500000, 1, 0x001F, 0x00E0 }, -- 2.20.1