Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2949325imm; Thu, 24 May 2018 19:42:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrTvjs3yIDMMgY7ZGkT4SpiChosl+ATF+VLqLatgtIWBxjjcDVZwGaygZhTPAf04foPJWuo X-Received: by 2002:a17:902:8c83:: with SMTP id t3-v6mr589765plo.357.1527216166802; Thu, 24 May 2018 19:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527216166; cv=none; d=google.com; s=arc-20160816; b=ldkJKX7S8PTWfNN8XvCqaUJewfV9Raw/8idTAaJTqufCsjcrsfeK1l3fa4e23Vio4B SvPDenRr/r3ETfROgLDr6uuX4HK4T56kZrjKL8mnNG2yOJAMXhr9Pizen50x+d/hNXer RRLtbA68dU40xDuqq9lXEkEJ6bC1QA3szid1E8PvKUL/foB4XR39gUUIWW67hbqlo8q4 yNK0yfa5TuopetWU+Rk/+msLx6bHVP+LshVgrkzhIbzeLBfPijR1SE4BmBTps5Ogh0kk IiusLrYKJt/gOmRuuXOVNMa6pZVlLwVOtUl9+1PDTtpjVqopgGQZA6c/sTjT4cwqsIA7 uh0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=BmduxscbAel/wba0uz6jRdt6wx+YM33aO1Sods1fY+A=; b=zGZPv3a9z9JnID01vUBxIyqO882sYpnEQeQCAWq6laHvQJi/fZfFIoxXZBL8/76plb 0F/78siZ85W7xh1DYvwFlHp6NLl2csT9vDN8iCzfldssXMnGAq8NDvEhTSrFvWM0tXvy 7MB+O/a2ocG0hmUUSJgngriMzIydwWX1uwSl5R3rNLHbD+wqwJ3II9CVZXgjACLnZZ5j PiSR29LJ5A2xaKN/HiZyxp17+cioWjvuNwfqT21o5labN97okfieRvBKMw9tNJkAgTT3 VMH4qSYjm92Rhjjq4/gbpFJ3PvBVpMcxjCJN2OdDKGw0HDoI9GhlHLO32S3Ans94kwwp X4Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eWBPmMLs; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1-v6si22125057plb.558.2018.05.24.19.42.32; Thu, 24 May 2018 19:42:46 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eWBPmMLs; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969254AbeEXUhp (ORCPT + 99 others); Thu, 24 May 2018 16:37:45 -0400 Received: from mail-yb0-f195.google.com ([209.85.213.195]:41966 "EHLO mail-yb0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969126AbeEXUhn (ORCPT ); Thu, 24 May 2018 16:37:43 -0400 Received: by mail-yb0-f195.google.com with SMTP id l2-v6so1085555ybp.8; Thu, 24 May 2018 13:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=BmduxscbAel/wba0uz6jRdt6wx+YM33aO1Sods1fY+A=; b=eWBPmMLstORl1mjhhA94EMy2qU+fYzGQw04AtDXIgpuGcZNtSWjC4mvJKvuxRrfd3L 4hEMVXIyidvifaQAWjiQl4cDF231UGoQ+ZyjgCLyYrfJowDEXOG8N0fRHnoAp3j+jh0d OUedRy8pwLsVa7884zArnEBHeLT4Syq7S+px8nB9LAVtFi6q0GTroRUP6vQzKzryydc2 M/k+4XbVPkGsVYVcnW/Q/7BT4TjjVve5mjQgNkR1SpRYbHrI7aYYu68YGGAgcCt1QU+/ khaZmvEEJttI2mlgfswO/Yoav5021TLRwWO9kgfNafXJk0/xnW9RiHf6AsUgIU9vo2bT 1Ezw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BmduxscbAel/wba0uz6jRdt6wx+YM33aO1Sods1fY+A=; b=UxixyG64hdFusv+jbujNWlC//SqvkiVuOfT2UCGR+cuknKTjH8vRxL6br8fCCVebSs xeU/HlxHYd/+c0LC6AgWGlPjfErG//EVHDDCfd7EptWHKIyqWCMp4iwYANw6zZsYYzd2 6ObhFDJB7IuuQSz92Std6Aosm37uUuwz923l4wX57xvx5NMfUPX05SHbSsJYOFzSgEp5 5EsOO3kPB24iw332eGD9Js16achfNBIA/41lffddvCDJjK3yTwJ03JRV6gjwzk5Bt1UH uFaG4cWW5Nf6vajG1+dLbQDTmNasQbpWOAtIfubRKktE30MXrpnwDBWl3O6XJf4hCUvs bnCQ== X-Gm-Message-State: ALKqPwe6j+i8iOuPFRHSWwL4XleGHsWHSzwfp2tkCjUpBCY1iqjq73hd 5Tmxs5FGlmQ6Y+2KzgitUn0= X-Received: by 2002:a25:48d:: with SMTP id 135-v6mr5333157ybe.101.1527194262607; Thu, 24 May 2018 13:37:42 -0700 (PDT) Received: from localhost ([72.188.97.40]) by smtp.gmail.com with ESMTPSA id t142-v6sm10309009ywc.33.2018.05.24.13.37.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 13:37:41 -0700 (PDT) From: William Breathitt Gray To: jic23@kernel.org Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, William Breathitt Gray Subject: [PATCH 0/2] Provide defines for 104-QUAD-8 magic numbers Date: Thu, 24 May 2018 16:37:35 -0400 Message-Id: X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Magic numbers can be difficult to understand, and at times hide bugs that would otherwise be obvious to readers of the source code. The first patch in this patchset provides a fix for an improperly selected magic number (an off-by-one error). The second patch adds defines to remove these magic numbers and thus help make the driver source code easier to read and debug. The discovery of the error fixed by the first patch is thanks to these defines: the improper magic number stuck out like a sore thumb next to the expected define symbol. So I should have used these defines from the start. William Breathitt Gray (2): iio: 104-quad-8: Fix off-by-one error in register selection iio: 104-quad-8: Provide defines for magic numbers drivers/iio/counter/104-quad-8.c | 86 ++++++++++++++++++++++---------- 1 file changed, 60 insertions(+), 26 deletions(-) -- 2.17.0