From patchwork Fri Jan 13 15:30:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lafreniere X-Patchwork-Id: 43388 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp340958wrt; Fri, 13 Jan 2023 07:48:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXuWOJpbVtuqRchA+TwTpAHSi/2KjertuTcTI5J1rhIwwIGWUYremgTsFuPkLrC38lbPZQ0S X-Received: by 2002:a05:6a20:a584:b0:ad:a5fd:b664 with SMTP id bc4-20020a056a20a58400b000ada5fdb664mr89793916pzb.37.1673624885878; Fri, 13 Jan 2023 07:48:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673624885; cv=none; d=google.com; s=arc-20160816; b=Mwzdt0s1GqMWM5TN21A28/SfSa/j3ZVt8t9ZYkOx9Up3EwhLZMj1gY/fhUD2FQdT6R yBAePIe0GNwMWMnnd83/9t29o3hXFOfTzLohtfe3Z+PbwqF9oAXsesmX2Foima7SjGoh 9DU2pa9t3pL2yV5w/H2aBiT0ygerzW8Z57Jb+8Lwo13H60YyUNtM7Ce6CWnsTeEr1Vun PeuiIvWAawbZuNyopDuO8uJPqC/SXnjUTM7nuaYOaqihqQ05GwHyTSCbWc1uKh2368nG ZqiRPDryQffmr9D1cXACsjrTmSCyWIhbLRF0TUaSssAh+yGIsRhgott9ev36ZvNXcEwZ 0Qmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:message-id:subject:cc:from:to:dkim-signature:date; bh=jbFxkExsMlV9xsBwHzYnqYf/viHGLmssqbaqiMZo0s0=; b=Y1nwrn9UdY+XWJfzMWocY76Ukn73jNqQy3g/DiSUB1gYbq1ZBGY85p2ycfO+dOimcj wdwjdk72FKci82qE1OJ3VGoZ3BxcLVtm8kjg7LiCkawEFD9uqQ2xv5Tw23BomJoVszYz f2Y5e+CHfs6TjX3daLwEFckmogZbO4pW6kiIXnMhWncdHCaZXPhLjzsFiXApMVV79yam QSIqQFbd+ylcL22+UmksIkxk5xLBzjMoCZvH2agZKW8HM51PhGl+2nYNWAioYRm67v2w VLuw9w6mwVowxgltvctFOKwQCiesOjf3lviO5jxZbpvyPLGR4pY9Y/Yy7jSVjvUUqDe8 4aGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@n8pjl.ca header.s=protonmail header.b="CM7DV48/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=n8pjl.ca Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lr17-20020a17090b4b9100b00225ddc6a8bcsi25593041pjb.166.2023.01.13.07.47.53; Fri, 13 Jan 2023 07:48:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@n8pjl.ca header.s=protonmail header.b="CM7DV48/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=n8pjl.ca Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229789AbjAMPjl (ORCPT + 99 others); Fri, 13 Jan 2023 10:39:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230349AbjAMPie (ORCPT ); Fri, 13 Jan 2023 10:38:34 -0500 Received: from mail-40136.proton.ch (mail-40136.proton.ch [185.70.40.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D2158BA90 for ; Fri, 13 Jan 2023 07:30:40 -0800 (PST) Date: Fri, 13 Jan 2023 15:30:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=n8pjl.ca; s=protonmail; t=1673623827; x=1673883027; bh=jbFxkExsMlV9xsBwHzYnqYf/viHGLmssqbaqiMZo0s0=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=CM7DV48/Ak0H02Fr785pQIKLcDaRYszEE2EFaNPnc4ybCQfBEQZ7R+n6+Pd/KrIT6 AGKazUm6H8LEs64o5KUZcfw+jyATbRA4hifXgIlQWwCB9ZqR9ll1MXWTx7y0xEE/3p uandkFmK0Ol9cOAa/puWvjKUb+/So+dKPOrd9LIHCrE4bJxQ0EkQrPpI3Q44mZeWvl oQmc4tmP9RARDw8C0su0K6MWlv4fzuy32NjbYA2s8J2qPW9qwyQPS47KeGcdX0Jl/f ViTrriFWaqbVYBvBenZPdwyXntF0DJXlaF2xfSxfgCgW+SLeq5FAxdSyeK8jm6mDtZ 5UI5OdxSEbDjQ== To: "linux-kernel@vger.kernel.org" From: Peter Lafreniere Cc: "linux@dominikbrodowski.net" , "kernel-janitors@vger.kernel.org" , "lukas.bulwahn@gmail.com" Subject: [PATCH] pcmcia: avoid defines prefixed with CONFIG Message-ID: Feedback-ID: 53133685:user:proton MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754922888639645364?= X-GMAIL-MSGID: =?utf-8?q?1754922888639645364?= Macros prefixed with "CONFIG_" should be relegated to Kconfig switches, so we should change the config state flags to avoid conflicts. This change affects only code readability, not function. Signed-off-by: Peter Lafreniere Reviewed-by: Lukas Bulwahn --- drivers/pcmcia/cs_internal.h | 6 +++--- drivers/pcmcia/pcmcia_resource.c | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h index 580369f3c0b0..95df616fb0a4 100644 --- a/drivers/pcmcia/cs_internal.h +++ b/drivers/pcmcia/cs_internal.h @@ -59,9 +59,9 @@ struct pccard_resource_ops { }; /* Flags in config state */ -#define CONFIG_LOCKED 0x01 -#define CONFIG_IRQ_REQ 0x02 -#define CONFIG_IO_REQ 0x04 +#define CFG_LOCKED 0x01 +#define CFG_IRQ_REQ 0x02 +#define CFG_IO_REQ 0x04 /* Flags in socket state */ #define SOCKET_PRESENT 0x0008 diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index d78091e79a0f..d559977b9332 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -168,7 +168,7 @@ static int pcmcia_access_config(struct pcmcia_device *p_dev, mutex_lock(&s->ops_mutex); c = p_dev->function_config; - if (!(c->state & CONFIG_LOCKED)) { + if (!(c->state & CFG_LOCKED)) { dev_dbg(&p_dev->dev, "Configuration isn't locked\n"); mutex_unlock(&s->ops_mutex); return -EACCES; @@ -262,7 +262,7 @@ int pcmcia_fixup_iowidth(struct pcmcia_device *p_dev) dev_dbg(&p_dev->dev, "fixup iowidth to 8bit\n"); if (!(s->state & SOCKET_PRESENT) || - !(p_dev->function_config->state & CONFIG_LOCKED)) { + !(p_dev->function_config->state & CFG_LOCKED)) { dev_dbg(&p_dev->dev, "No card? Config not locked?\n"); ret = -EACCES; goto unlock; @@ -310,7 +310,7 @@ int pcmcia_fixup_vpp(struct pcmcia_device *p_dev, unsigned char new_vpp) dev_dbg(&p_dev->dev, "fixup Vpp to %d\n", new_vpp); if (!(s->state & SOCKET_PRESENT) || - !(p_dev->function_config->state & CONFIG_LOCKED)) { + !(p_dev->function_config->state & CFG_LOCKED)) { dev_dbg(&p_dev->dev, "No card? Config not locked?\n"); ret = -EACCES; goto unlock; @@ -361,9 +361,9 @@ int pcmcia_release_configuration(struct pcmcia_device *p_dev) s->ops->set_socket(s, &s->socket); } } - if (c->state & CONFIG_LOCKED) { - c->state &= ~CONFIG_LOCKED; - if (c->state & CONFIG_IO_REQ) + if (c->state & CFG_LOCKED) { + c->state &= ~CFG_LOCKED; + if (c->state & CFG_IO_REQ) for (i = 0; i < MAX_IO_WIN; i++) { if (!s->io[i].res) continue; @@ -407,7 +407,7 @@ static void pcmcia_release_io(struct pcmcia_device *p_dev) release_io_space(s, &c->io[1]); p_dev->_io = 0; - c->state &= ~CONFIG_IO_REQ; + c->state &= ~CFG_IO_REQ; out: mutex_unlock(&s->ops_mutex); @@ -491,7 +491,7 @@ int pcmcia_enable_device(struct pcmcia_device *p_dev) mutex_lock(&s->ops_mutex); c = p_dev->function_config; - if (c->state & CONFIG_LOCKED) { + if (c->state & CFG_LOCKED) { mutex_unlock(&s->ops_mutex); dev_dbg(&p_dev->dev, "Configuration is locked\n"); return -EACCES; @@ -581,7 +581,7 @@ int pcmcia_enable_device(struct pcmcia_device *p_dev) } /* Configure I/O windows */ - if (c->state & CONFIG_IO_REQ) { + if (c->state & CFG_IO_REQ) { iomap.speed = io_speed; for (i = 0; i < MAX_IO_WIN; i++) if (s->io[i].res) { @@ -602,7 +602,7 @@ int pcmcia_enable_device(struct pcmcia_device *p_dev) } } - c->state |= CONFIG_LOCKED; + c->state |= CFG_LOCKED; p_dev->_locked = 1; mutex_unlock(&s->ops_mutex); return 0; @@ -635,11 +635,11 @@ int pcmcia_request_io(struct pcmcia_device *p_dev) goto out; } - if (c->state & CONFIG_LOCKED) { + if (c->state & CFG_LOCKED) { dev_dbg(&p_dev->dev, "Configuration is locked\n"); goto out; } - if (c->state & CONFIG_IO_REQ) { + if (c->state & CFG_IO_REQ) { dev_dbg(&p_dev->dev, "IO already configured\n"); goto out; } @@ -663,7 +663,7 @@ int pcmcia_request_io(struct pcmcia_device *p_dev) } else c->io[1].start = 0; - c->state |= CONFIG_IO_REQ; + c->state |= CFG_IO_REQ; p_dev->_io = 1; dev_dbg(&p_dev->dev, "pcmcia_request_io succeeded: %pR , %pR",