From patchwork Mon Oct 12 14:31:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 54772 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 0171522DB6 for ; Mon, 12 Oct 2015 14:33:51 +0000 (UTC) Received: by wijq8 with SMTP id q8sf35112841wij.1 for ; Mon, 12 Oct 2015 07:33:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=BSgkE6pbaWHsdPLXJyIec8CEIGVHUhWW9CrU1W8T67E=; b=Iy/O9/nIE08xhXqCHunedZHxCc7+r21MWOLzw/WvGjCcU2AesQvIvkczqxpYgrqZ+5 uiOHCZaCLQ9KWMRSE8+NFOIHtzo0LNISNz08rkfjHPF3DXenyI4mbGFuN/lTTgG24fD9 Ffuvqi7natsMXJ//d74g1wpYQJ50mChc/NrBUsPOh7l28RkRwXzTOFhdOBZI66DbS2EE NYEw4h1wqkWuCCrl/5iQOdocvI5LEpECwQhkFI6xSVb56Zud0HnyhgLqVnWwElzqj110 4g859g66lmzffT1k8T6rZQ03NXGXX5yVe3Kp9VB1K+hoXOoutTLkzprxoJE0Y3lqPsJZ 4v0A== X-Gm-Message-State: ALoCoQlft0x29WKTS3tEhVXkfP2D+0X0xsw00/+El4wVezlKwWNuaJjf6BXerTho+O3p9ym7ikB/ X-Received: by 10.112.136.99 with SMTP id pz3mr5755379lbb.11.1444660430315; Mon, 12 Oct 2015 07:33:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.165.18 with SMTP id o18ls93803lfe.39.gmail; Mon, 12 Oct 2015 07:33:50 -0700 (PDT) X-Received: by 10.25.40.65 with SMTP id o62mr8271323lfo.115.1444660430145; Mon, 12 Oct 2015 07:33:50 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id px4si11436903lbb.19.2015.10.12.07.33.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2015 07:33:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbck17 with SMTP id ck17so24744216lbb.1 for ; Mon, 12 Oct 2015 07:33:50 -0700 (PDT) X-Received: by 10.25.40.130 with SMTP id o124mr8048380lfo.41.1444660430029; Mon, 12 Oct 2015 07:33:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1583776lbq; Mon, 12 Oct 2015 07:33:49 -0700 (PDT) X-Received: by 10.68.211.131 with SMTP id nc3mr35070040pbc.159.1444660429034; Mon, 12 Oct 2015 07:33:49 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bx2si26452198pab.140.2015.10.12.07.33.48; Mon, 12 Oct 2015 07:33:49 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753025AbbJLOdr (ORCPT + 30 others); Mon, 12 Oct 2015 10:33:47 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:38465 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752032AbbJLOci (ORCPT ); Mon, 12 Oct 2015 10:32:38 -0400 Received: by wieq12 with SMTP id q12so23301534wie.1 for ; Mon, 12 Oct 2015 07:32:37 -0700 (PDT) X-Received: by 10.180.87.74 with SMTP id v10mr13888442wiz.66.1444660356644; Mon, 12 Oct 2015 07:32:36 -0700 (PDT) Received: from localhost.localdomain (LPoitiers-656-1-62-228.w90-63.abo.wanadoo.fr. [90.63.143.228]) by smtp.gmail.com with ESMTPSA id az6sm11102907wib.12.2015.10.12.07.32.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Oct 2015 07:32:36 -0700 (PDT) From: Bartosz Golaszewski To: Wolfram Sang Cc: linux-i2c , LKML , Patrick Titiano , Bartosz Golaszewski Subject: [PATCH 9/9] eeprom: at24: readability tweaks Date: Mon, 12 Oct 2015 16:31:21 +0200 Message-Id: <1444660281-19150-10-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1444660281-19150-1-git-send-email-bgolaszewski@baylibre.com> References: <1444660281-19150-1-git-send-email-bgolaszewski@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bgolaszewski@baylibre.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Move the macro definitions above the struct definitions and add some tabs for better readability. Signed-off-by: Bartosz Golaszewski --- drivers/misc/eeprom/at24.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index 52875f4..0f873db 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c @@ -52,6 +52,14 @@ * which won't work on pure SMBus systems. */ +#define AT24_SIZE_BYTELEN 5 +#define AT24_SIZE_FLAGS 8 + +#define AT24_BITMASK(x) (BIT(x) - 1) + +#define AT24CS_SERIAL_SIZE 16 +#define AT24CS_SERIAL_ADDR(addr) (addr + 0x08) + struct at24_data { struct at24_platform_data chip; struct memory_accessor macc; @@ -98,14 +106,6 @@ static unsigned write_timeout = 25; module_param(write_timeout, uint, 0); MODULE_PARM_DESC(write_timeout, "Time (in ms) to try writes (default 25)"); -#define AT24_SIZE_BYTELEN 5 -#define AT24_SIZE_FLAGS 8 - -#define AT24_BITMASK(x) (BIT(x) - 1) - -#define AT24CS_SERIAL_SIZE 16 -#define AT24CS_SERIAL_ADDR(addr) (addr + 0x08) - /* create non-zero magic value for given eeprom parameters */ #define AT24_DEVICE_MAGIC(_len, _flags) \ ((1 << AT24_SIZE_FLAGS | (_flags)) \