From patchwork Sat Sep 28 19:19:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Otavio Salvador X-Patchwork-Id: 278765 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 69F582C0109 for ; Sun, 29 Sep 2013 05:27:30 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1F3BE4A0D2; Sat, 28 Sep 2013 21:27:29 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hxcbEeuevlLh; Sat, 28 Sep 2013 21:27:28 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E5D184A0F2; Sat, 28 Sep 2013 21:27:20 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 572C04A0DF for ; Sat, 28 Sep 2013 21:27:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IozZevnemFkr for ; Sat, 28 Sep 2013 21:27:10 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-qc0-f180.google.com (mail-qc0-f180.google.com [209.85.216.180]) by theia.denx.de (Postfix) with ESMTPS id 28A874A0C0 for ; Sat, 28 Sep 2013 21:27:03 +0200 (CEST) Received: by mail-qc0-f180.google.com with SMTP id p19so2579505qcv.25 for ; Sat, 28 Sep 2013 12:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :organization; bh=Nzf0j86F6y6uxSJCN1x40DrPdo0r5mBCRmuKFbPcdBs=; b=zowReumHT+xclVS5durnY0P1/CserjDnsQvL6NOX4evHhJYY09JD1SkTZZpGWKQRW7 hcKRNRevJDOzEBjxC2mThwbxhEP7hrKNdVUo6ksRJ7pE5ue82Vbl/eySnUiazJfo6r8S CxKrnwsg7P0PVKhkwmxgxSvGlvagMVDFvxPepyVtxsBOalF48bbal5X/9vFzC+TEQrZ/ j+k4DPkGetj195TL2I9c/3UqbKvaEZRuzeUcGNP5Xrseb/Z4zyCIvUJ6OfCPgQY1w6rH TXmQAMr/ZQ7EfR446Sy9izPvj1jFX1vWzWOqTCHsSy5WsGtZ4GTOaSf1P0iwjI9n9yUC DRpA== X-Received: by 10.49.70.129 with SMTP id m1mr17493279qeu.69.1380395987518; Sat, 28 Sep 2013 12:19:47 -0700 (PDT) Received: from nano.lab.ossystems.com.br ([177.194.209.11]) by mx.google.com with ESMTPSA id h2sm25188812qev.0.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 28 Sep 2013 12:19:46 -0700 (PDT) From: Otavio Salvador To: U-Boot Mailing List Date: Sat, 28 Sep 2013 16:19:23 -0300 Message-Id: <1380395965-14125-4-git-send-email-otavio@ossystems.com.br> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1380395965-14125-1-git-send-email-otavio@ossystems.com.br> References: <1380395965-14125-1-git-send-email-otavio@ossystems.com.br> Organization: O.S. Systems Software LTDA. Cc: Otavio Salvador Subject: [U-Boot] [PATCH v2 4/6] status_led: Print an error when the LED id is out of range X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Otavio Salvador --- Changes in v2: - new patch drivers/misc/status_led.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 1.8.4.rc3 diff --git a/drivers/misc/status_led.c b/drivers/misc/status_led.c index 6b71ad4..33148c9 100644 --- a/drivers/misc/status_led.c +++ b/drivers/misc/status_led.c @@ -94,9 +94,10 @@ void status_led_set (int led, int state) { led_dev_t *ld; - if (led < 0 || led >= MAX_LED_DEV) + if (led < 0 || led >= MAX_LED_DEV) { + printf("ERROR: LED bit is out of range\n"); return; + } if (!status_led_init_done) status_led_init (); --