From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hqemgate15.nvidia.com (hqemgate15.nvidia.com. [216.228.121.64]) by gmr-mx.google.com with ESMTPS id 190si668417pfb.1.2016.01.22.01.49.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2016 01:49:52 -0800 (PST) Message-ID: <56A1F8BB.9090803@nvidia.com> Date: Fri, 22 Jan 2016 15:09:07 +0530 From: Laxman Dewangan MIME-Version: 1.0 To: Javier Martinez Canillas , CC: Kukjin Kim , , Chanwoo Choi , Alexandre Belloni , Krzysztof Kozlowski , Subject: [rtc-linux] Re: [PATCH v2 02/10] rtc: max77686: Use ARRAY_SIZE() instead of current array length References: <1453407813-14646-1-git-send-email-javier@osg.samsung.com> <1453407813-14646-3-git-send-email-javier@osg.samsung.com> In-Reply-To: <1453407813-14646-3-git-send-email-javier@osg.samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Reply-To: rtc-linux@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , On Friday 22 January 2016 01:53 AM, Javier Martinez Canillas wrote: > It is better to use the ARRAY_SIZE() macro instead of the array length > to avoid bugs if the array is later changed and the length not updated. > > Signed-off-by: Javier Martinez Canillas > Reviewed-by: Krzysztof Kozlowski > > Acked-by: Laxman Dewangan Similar stuffs are there on multiple places: u8 data[RTC_NR_TIME]; ::: ret = regmap_bulk_read(info->max77686->rtc_regmap, MAX77686_ALARM1_SEC, data, RTC_NR_TIME); Should we say: ret = regmap_bulk_read(info->max77686->rtc_regmap, MAX77686_ALARM1_SEC, data, ARRAY_SIZE(data)); -- -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.